[cfe-dev] Next batch of -Wgnu flags

Peter N Lewis peter at stairways.com.au
Thu Aug 29 19:40:07 PDT 2013


On 30/08/2013, at 6:56 , Eli Friedman <eli.friedman at gmail.com> wrote:
> gnu-empty-struct, gnu-struct-without-named-member, and gnu-only-flexible-array-member are all variants of the same extension (allowing structs without a named member); it probably makes sense to put them all under gnu-empty-struct.

OK, I'll use that when I submit the patch.

> gnu-folding-initializer-constant and gnu-folding-integer-constant are also variants of the same extension (along with ext_vla_folded_to_constant)

OK, I'll use that when I submit the patch.  I will try to add it for ext_vla_folded_to_constant as well.

> gnu-redeclared-class-member probably shouldn't have "gnu" in the name; it's not really an intentional extension.

So just -Wredeclared-class-member?  Ok, can do.

> (This isn't a formal review; please continue to submit patches as you have been doing.)

Yep, it was probably a mistake to post here, just figured I'd give people an opportunity to comment on the flag names independent of the code review.

On 30/08/2013, at 9:51 , Richard Smith <richard at metafoo.co.uk> wrote:
> >gnu-binary-literal
> 
> This is also a C++1y language extension; we should put it under -Wc++1y-extensions in C++ mode, and under -Wgnu-binary-literal in C mode.

OK, I'll look in to adding that as a follow on patch after the current one is submitted.

> >gnu-line-zero-directive
> 
> Maybe -Wgnu-#line-0? (We have precedent for # in a warning name: -W#warnings, -W#pragma-messages)
>  
> gnu-token-pasting-comma
> gnu-zero-variadic-macro-arguments
> 
> These two are the definition and use side of the same feature, so should probably live under the same flag.

I've changed the patch (see clang-commits thread " [PATCH] Add more specific lexer flags for misc GNU extensions") to use -Wgnu-zero-variadic-macro-arguments for both of those, and  -Wgnu-zero-line-directive for -Wgnu-zero-line-directive.  If people prefer -Wgnu-#line-0 to -Wgnu-zero-line-directive, I can update that patch as well.  Probably best to post on the commits thread for that - I probably shouldn't have posted here, and definitely shouldn't have mentioned the flags in the patch on the commits thread.  My apologies for that, it wont happen again.
   Peter.

-- 
Keyboard Maestro 6.2 now out - control Mail, reveal a file, format AppleScripts and more.

Keyboard Maestro <http://www.keyboardmaestro.com/> Macros for your Mac
<http://www.stairways.com/>           <http://download.keyboardmaestro.com/>





More information about the cfe-dev mailing list