RFC: PATCH to adjust warning flags for C++

Gabriel Dos Reis gdr@integrable-solutions.net
Wed Nov 2 12:42:00 GMT 2011


On Wed, Nov 2, 2011 at 12:40 AM, Jason Merrill <jason@redhat.com> wrote:
> On 11/02/2011 12:05 AM, Gabriel Dos Reis wrote:
>>>
>>>  And I think that "your code won't work in C++11" is
>>> a warning that most C++ programmers will be interested in if they are
>>> asking
>>> for warnings.
>>
>> Even when -std=c++03 -Wall or -std=c++98 -Wall?
>
> Yes.  -Wc++0x-compat has been part of -Wall for almost 5 years.  If people
> don't want narrowing warnings, they can use -Wno-narrowing, which is
> helpfully mentioned in the warnings themselves.
>

narrowing is just one issue.

Originally, we were checking mostly for clashes in identifiers and the like.
And we should have been more cautious then.  Now that C++11 support
is far better, I think it is still time to correct what we should have done.
At least not warning when the standard is explicitly selected, as opposed
to whatever the default is.  That is, if -std=c++03 or -std=c++98 is
explicitly given
on the command line, we should avoid including -Wc++0x-compat in -Wall.



More information about the Gcc-patches mailing list