RFC: PR 25137: moving -Wmissing-braces to -Wextra?
Richard Henderson
rth@redhat.com
Wed Nov 18 20:27:00 GMT 2009
On 11/18/2009 10:43 AM, Paolo Carlini wrote:
> struct S5 { int s[3]; };
> struct S5 { struct S5 a; int b; };
> struct S5 s34 = { { 1, 1, 1 }, 1 };
Please also test
struct S1 { int s[3], t };
struct S2 { struct S1 a; };
struct S3 { struct S1 a; int i; };
struct S2 s1 = { 1, 1, 1, 1 }; // warn
struct S2 s2 = { { 1, 1, 1 }, 1 }; // no warn
struct S3 s3 = { { 1, 1, 1, 1 }, 1 }; // warn
I didn't look at the code yet, but the test cases that you do have look
good, including the change in the aggregate you choose to reference in
the warning.
> In case, the same kind of change should be implemented in the C
> front-end, right?
Yes.
r~
More information about the Gcc
mailing list