Hi, On 06/01/2013 09:23 PM, Christof Mroz wrote:
My guess is that the code breaks strict aliasing in a way which is not catched by -Wall. IIRC strict aliasing warnings can yield false positives, so they are possibly disabled for warnings-as-errors.
checksum.c does not generate any warnings.
You could try compiling with -fno-strict-aliasing but all other optimizations turned on, and seeing if it solves the problem (possibly after changing "unsigned short" to "uint16_t").
How to enable this just for a single file? I believe the compilation breaks otherwise.
Of course, I don't mean that using a compiler flag is the fix (but making the code portable is).
I am open to any suggestions.