Project

General

Profile

Defect #3

custom PDU factory test fails with optimizations on under GCC 4.4.5

Added by Tony Ciavarella about 6 years ago. Updated almost 6 years ago.

Status:
Closed
Priority:
Normal
Target version:
Start date:
03/12/2013
Due date:
% Done:

100%

Estimated time:

Description

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...

Associated revisions

Revision 442:b5f751f07b55 (diff)
Added by Tony Ciavarella about 6 years ago

use enum classes with appropriate underlying type for SISO ref 010 enums. refs #5, #3

History

#1 Updated by Tony Ciavarella about 6 years ago

  • Description updated (diff)

#2 Updated by Tony Ciavarella almost 6 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