This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RFC: PR 25137: moving -Wmissing-braces to -Wextra?


I'm trying to resolve one way or another this PR, which I have assigned
to myself a long time ago... The issue essentially is very simple. This
kind of code:

    struct S { int s[3]; };
    struct S s1 = { 1, 1, 1 };

triggers a warning with -Wall about missing braces around initializer,
which some people consider a bit overzealous, in particular in
relationship with std::array (std::tr1::array).

Today, I was comparing GCC to ICC and SunStudio and noticed that, please
correct me if I'm wrong about the details:

    - ICC: lacks completely an equivalent of -Wmissing-braces, never warns.
    - SunStudio: only warns with +w2, doesn't warn with +w.

Therefore, my idea to resolve 25137 and make progress in this area would
be moving -Wmissing-braces from -Wall to -Wextra: the corresponding
patch, as expected, is trivial, and it would be for me only matter to
tweak the testsuites a bit (A refinement of that proposal would be doing
the change only for the C++ front-end)

Suggestions, other proposals?


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]