This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [wwwdocs] Add various new warnings for GCC 7
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Gerald Pfeifer <gerald at pfeifer dot com>
- Cc: Marek Polacek <polacek at redhat dot com>, GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Fri, 27 Jan 2017 21:39:56 +0100
- Subject: Re: [wwwdocs] Add various new warnings for GCC 7
- Authentication-results: sourceware.org; auth=none
- References: <20170127161322.GC6809@redhat.com> <20170127163648.GX1867@tucnak> <alpine.LSU.2.20.1701272130590.2449@anthias.pfeifer.com>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Fri, Jan 27, 2017 at 09:32:05PM +0100, Gerald Pfeifer wrote:
> On Fri, 27 Jan 2017, Jakub Jelinek wrote:
> > For -Wregister I think it would be better to write more:
> > <li><code>-Wregister</code> warns about uses of <code>register</code> storage
> > specifier. In C++17 this keyword has been removed and for C++17
> > this is a pedantic warning enabled by default. The warning is not
> > emitted for the GNU Explicit Register Variables extension.</li>
>
> Is C++17 correct in both cases? If the register keyword has been
> removed, wouldn't that be an error as opposed to just a warning?
For C++17 it is a pedwarn, i.e. an error with -pedantic-errors, or
-Werror=register, warning otherwise, no diagnostics with -Wno-register.
For C++14 and ealier it is (non-default) normal warning, i.e. a warning
with -Wregister, no warning by default or with -Wno-register, error with
-Werror=register.
Jakub