Project

General

Profile

Actions

Defect #3

closed

custom PDU factory test fails with optimizations on under GCC 4.4.5

Added by Tony Ciavarella about 11 years ago. Updated almost 11 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...

Actions #1

Updated by Tony Ciavarella about 11 years ago

  • Description updated (diff)
Actions #2

Updated by Tony Ciavarella almost 11 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.

Actions

Also available in: Atom PDF