NO

Author Topic: warning #2805: Possible violation of strict-aliasing rules  (Read 2613 times)

Grincheux

  • Guest
warning #2805: Possible violation of strict-aliasing rules
« on: March 08, 2016, 04:28:49 PM »
What does it mean? :-[

JohnF

  • Guest
Re: warning #2805: Possible violation of strict-aliasing rules
« Reply #1 on: March 08, 2016, 05:08:33 PM »
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