Pelles C forum

C language => Beginner questions => Topic started by: Grincheux on March 08, 2016, 04:28:49 PM

Title: warning #2805: Possible violation of strict-aliasing rules
Post by: Grincheux on March 08, 2016, 04:28:49 PM
What does it mean? :-[
Title: Re: warning #2805: Possible violation of strict-aliasing rules
Post by: JohnF 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