Hi, the command line option -Wattribute-alias (w/o the "=1") is currently broken, and only -Wno-attribute-alias is still working, but what is worse, is that the #pragma GCC diagnostic fails to recognize the string "-Wattribute-alias", as it used to do in gcc-8, which breaks the linux warning suppression macro because it relies on a _Pragma to work.
Fixed by declaring -Wattribute-alias as an alias to -Wattribute-alias=1 and the negated form as an alias to -Wattribute-alias=0. Bootstrapped and reg-tested on x86_64-pc-linux-gnu. Is it OK for trunk? Additionally I looked into the linux 4.20 build, got a couple "-Wmissing-attributes" which seem easy to fix (by adding the cold attribute) and quite a lot "-Waddress-of-packed-member" warnings, which I don't know how to fix properly. Thanks Bernd.
2019-01-19 Bernd Edlinger <bernd.edlin...@hotmail.de> * common.opt (-Wattribute-alias): Remove "no-" from name. Make -Wattribute-alias command line option and #pragma GCC diagnostic ignore "-Wattribute-alias" work again. testsuite: 2019-01-19 Bernd Edlinger <bernd.edlin...@hotmail.de> * gcc.dg/Wattribute-alias.c: Add test for #pragma GCC diagnostic ignore "-Wattribute-alias". Index: gcc/common.opt =================================================================== --- gcc/common.opt (revision 268084) +++ gcc/common.opt (working copy) @@ -550,14 +550,14 @@ Wattributes Common Var(warn_attributes) Init(1) Warning Warn about inappropriate attribute usage. +Wattribute-alias +Common Alias(Wattribute_alias=, 1, 0) Warning +Warn about type safety and similar errors and mismatches in attribute alias and related. + Wattribute-alias= Common Joined RejectNegative UInteger Var(warn_attribute_alias) Init(1) Warning IntegerRange(0, 2) Warn about type safety and similar errors and mismatches in attribute alias and related. -Wno-attribute-alias -Common Alias(Wattribute_alias=, 0, 0) Warning -Disable -Wattribute-alias. - Wcannot-profile Common Var(warn_cannot_profile) Init(1) Warning Warn when profiling instrumentation was requested, but could not be applied to Index: gcc/testsuite/gcc.dg/Wattribute-alias.c =================================================================== --- gcc/testsuite/gcc.dg/Wattribute-alias.c (revision 268084) +++ gcc/testsuite/gcc.dg/Wattribute-alias.c (working copy) @@ -14,6 +14,13 @@ ATTR (alias ("target_no_nothrow"), nothrow) void alias_nothrow (void); /* { dg-warning ".alias_nothrow. specifies more restrictive attribute than its target .target_no_nothrow.: .nothrow." } */ +#pragma GCC diagnostic push "-Wattribute-alias" +#pragma GCC diagnostic ignored "-Wattribute-alias" +ATTR (alias ("target_no_nothrow"), nothrow) void +alias_nothrow_ignored (void); +#pragma GCC diagnostic pop "-Wattribute-alias" + + ATTR (pure) int alias_pure (void);