Schlagwort-Archive: c

Troubles with GCC signed integer overflow optimization

As signed integer wraparound (overflow) is not defined by C/C++ standards, GCC sometimes optimizes expressions with the assumption that wraparound does not happen, even though the CPU very well does perform wraparound. This can lead to cases in which the … Weiterlesen

Veröffentlicht unter Computing | Verschlagwortet mit , , , , | 1 Kommentar

GCC strict aliasing pitfall

In some cases of badly written C/C++ code, the behaviour of a program may depend on the optimization level that was used to compile the code because GCC applies strict aliasing optimizations when compiling with -O2 or higher. According to … Weiterlesen

Veröffentlicht unter Computing | Verschlagwortet mit , , , , | 2 Kommentare