https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60784

--- Comment #7 from Peter Wu <peter at lekensteyn dot nl> ---
This bug is still present in GCC 4.9.2 and 4.9.3 (prerelease 20141210). Now
building gcc-5-20141207 to verify. (Not sure whether this gets backported to
4.9.x, just checking.)

//////////////////////////////////////////
gcc -Wextra bug.c -o /dev/null
//////////////////////////////////////////
typedef struct HidppMessage {
    struct {
        int feature_index;
        int func;
    };
} HidppMessage;

int main(void) {
    HidppMessage req = {
        .feature_index  = 0xFF,
        .func           = 1
    };
    return req.func;
}
//////////////////////////////////////////

Strange enough, replacing 0xFF by 0x00 hides the warning.

Reply via email to