warning #2805: Possible violation of strict-aliasing rules

Started by Grincheux, March 08, 2016, 04:28:49 PM

Previous topic - Next topic

JohnF

Try Google.

Strict aliasing is the requirement from C99 that an object be accessed only by its own type or by char (see the exact definition from C99 below). That means the following is not acceptable:

        int i = 42;
        short s = *(short*)&i;


John