Re: [PATCH] Fix -Wattribute-alias option

2019-01-27 Thread Jakub Jelinek
On Sat, Jan 19, 2019 at 10:06:29AM +, Bernd Edlinger wrote:
> 2019-01-19  Bernd Edlinger  
> 
>   * 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  
> 
>   * gcc.dg/Wattribute-alias.c: Add test for #pragma GCC diagnostic ignore
>   "-Wattribute-alias".

Ok, thanks.

Jakub


Re: [PATCH] Fix -Wattribute-alias option

2019-01-21 Thread Martin Sebor

On 1/21/19 8:55 AM, Bernd Edlinger wrote:



On 1/21/19 4:42 PM, Arnd Bergmann wrote:

On Sat, Jan 19, 2019 at 11:06 AM Bernd Edlinger
 wrote:


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.


I'm surprised by this, since I have not seen the warning in a while. I am
however still using gcc-8.1 locally. Did this change later during the
gcc-8 branch?



Yes.

The -Wattribute-alias was split up in -Wattribute-alias=1 an -Wattribute-alias=2
and -Wmissing-attributes on gcc-trunk (but not in the gcc-8 branch as far as I 
know).

The -Wmissing-attribute also triggers in include/linux/module.h but for that 
one,
I will probably have to send a patch to the linux-kernel list.


Miguel Ojeda has been working with me on the kernel changes.

Martin




$ svn log -r265980

r265980 | msebor | 2018-11-09 18:32:52 +0100 (Fri, 09 Nov 2018) | 39 lines

PR middle-end/81824 - Warn for missing attributes with function aliases

gcc/c-family/ChangeLog:

PR middle-end/81824
* c-attribs.c (handle_copy_attribute): New function.

gcc/cp/ChangeLog:

PR middle-end/81824
* pt.c (warn_spec_missing_attributes): Move code to attribs.c.
Call decls_mismatched_attributes.

gcc/ChangeLog:

PR middle-end/81824
* attribs.c (has_attribute): New helper function.
(decls_mismatched_attributes, maybe_diag_alias_attributes): Same.
* attribs.h (decls_mismatched_attributes): Declare.
* cgraphunit.c (handle_alias_pairs): Call maybe_diag_alias_attributes.
(maybe_diag_incompatible_alias): Use OPT_Wattribute_alias_.
* common.opt (-Wattribute-alias): Take an argument.
(-Wno-attribute-alias): New option.
* doc/extend.texi (Common Function Attributes): Document copy.
(Common Variable Attributes): Same.
* doc/invoke.texi (-Wmissing-attributes): Document enhancement.
(-Wattribute-alias): Document new option argument.

gcc/testsuite/ChangeLog:

PR middle-end/81824
* gcc.dg/Wattribute-alias.c: New test.
* gcc.dg/Wmissing-attributes.c: New test.
* gcc.dg/attr-copy.c: New test.
* gcc.dg/attr-copy-2.c: New test.
* gcc.dg/attr-copy-3.c: New test.
* gcc.dg/attr-copy-4.c: New test.



Bernd.





Re: [PATCH] Fix -Wattribute-alias option

2019-01-21 Thread Arnd Bergmann
On Mon, Jan 21, 2019 at 4:55 PM Bernd Edlinger
 wrote:
> On 1/21/19 4:42 PM, Arnd Bergmann wrote:
> > On Sat, Jan 19, 2019 at 11:06 AM Bernd Edlinger
> >  wrote:
> >>
> >> 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.
> >
> > I'm surprised by this, since I have not seen the warning in a while. I am
> > however still using gcc-8.1 locally. Did this change later during the
> > gcc-8 branch?
> >
>
> Yes.
>
> The -Wattribute-alias was split up in -Wattribute-alias=1 an 
> -Wattribute-alias=2
> and -Wmissing-attributes on gcc-trunk (but not in the gcc-8 branch as far as 
> I know).
>
> The -Wmissing-attribute also triggers in include/linux/module.h but for that 
> one,
> I will probably have to send a patch to the linux-kernel list.

I got it, I misread your earlier message as saying that it also
happened on gcc-8.

 Arnd


Re: [PATCH] Fix -Wattribute-alias option

2019-01-21 Thread Bernd Edlinger


On 1/21/19 4:42 PM, Arnd Bergmann wrote:
> On Sat, Jan 19, 2019 at 11:06 AM Bernd Edlinger
>  wrote:
>>
>> 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.
> 
> I'm surprised by this, since I have not seen the warning in a while. I am
> however still using gcc-8.1 locally. Did this change later during the
> gcc-8 branch?
> 

Yes.

The -Wattribute-alias was split up in -Wattribute-alias=1 an -Wattribute-alias=2
and -Wmissing-attributes on gcc-trunk (but not in the gcc-8 branch as far as I 
know).

The -Wmissing-attribute also triggers in include/linux/module.h but for that 
one,
I will probably have to send a patch to the linux-kernel list.


$ svn log -r265980

r265980 | msebor | 2018-11-09 18:32:52 +0100 (Fri, 09 Nov 2018) | 39 lines

PR middle-end/81824 - Warn for missing attributes with function aliases

gcc/c-family/ChangeLog:

PR middle-end/81824
* c-attribs.c (handle_copy_attribute): New function.

gcc/cp/ChangeLog:

PR middle-end/81824
* pt.c (warn_spec_missing_attributes): Move code to attribs.c.
Call decls_mismatched_attributes.

gcc/ChangeLog:

PR middle-end/81824
* attribs.c (has_attribute): New helper function.
(decls_mismatched_attributes, maybe_diag_alias_attributes): Same.
* attribs.h (decls_mismatched_attributes): Declare.
* cgraphunit.c (handle_alias_pairs): Call maybe_diag_alias_attributes.
(maybe_diag_incompatible_alias): Use OPT_Wattribute_alias_.
* common.opt (-Wattribute-alias): Take an argument.
(-Wno-attribute-alias): New option.
* doc/extend.texi (Common Function Attributes): Document copy.
(Common Variable Attributes): Same.
* doc/invoke.texi (-Wmissing-attributes): Document enhancement.
(-Wattribute-alias): Document new option argument.

gcc/testsuite/ChangeLog:

PR middle-end/81824
* gcc.dg/Wattribute-alias.c: New test.
* gcc.dg/Wmissing-attributes.c: New test.
* gcc.dg/attr-copy.c: New test.
* gcc.dg/attr-copy-2.c: New test.
* gcc.dg/attr-copy-3.c: New test.
* gcc.dg/attr-copy-4.c: New test.



Bernd.


Re: [PATCH] Fix -Wattribute-alias option

2019-01-21 Thread Arnd Bergmann
On Sat, Jan 19, 2019 at 11:06 AM Bernd Edlinger
 wrote:
>
> 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.

I'm surprised by this, since I have not seen the warning in a while. I am
however still using gcc-8.1 locally. Did this change later during the
gcc-8 branch?

 Arnd