Defect #3

custom PDU factory test fails with optimizations on under GCC 4.4.5

Added by Tony Ciavarella about 7 years ago. Updated about 7 years ago.

Target version:
Start date:
Due date:
% Done:


Estimated time:


GCC 4.4.5, the ancient default GCC on Debian 6.x (Squeeze), coughs this up when running the optimized pdu_factory test:

[FAIL]: Factory created a PDU for type 237 but its header.pdu_type was 237 (../../tests/pdu_factory/test.cpp:57)

The debug variant works fine on this compiler.

It seems that any assigned value above 127 for the PDU type causes this kind of strange error. I'm assuming the compiler is doing something to internally optimize the enum down to an 8 bit signed value (which fits the full range of defined values in source:src/disorder/siso/ref_010_enums.hpp).

Not sure how best to work around this problem. A quick check of GCC bug reports yielded nothing although this seems to work fine in later GCC versions...


Updated by Tony Ciavarella about 7 years ago

  • Description updated (diff)

Updated by Tony Ciavarella about 7 years ago

  • Status changed from New to Closed
  • % Done changed from 0 to 100

GCC 4.7+ is now the required minimum GCC version so this issue is invalid. However, the siso::PDUType enum has been changed to a C++11 strongly typed enum which should eliminate any chance of a different compiler trying a similar trick.

Also available in: Atom PDF