This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: C PATCH to detect clashing attributes (PR c/81544)
- From: Joseph Myers <joseph at codesourcery dot com>
- To: Marek Polacek <polacek at redhat dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Mon, 31 Jul 2017 22:33:41 +0000
- Subject: Re: C PATCH to detect clashing attributes (PR c/81544)
- Authentication-results: sourceware.org; auth=none
- References: <20170725153831.GG3397@redhat.com>
On Tue, 25 Jul 2017, Marek Polacek wrote:
> PR c/81544 complaints that we aren't detecting clashing noreturn /
> warn_unused_result attributes so this patch adds that checking. Martin
> plans to do more systematic checking in this area but meanwhile we
> might want to go with this.
>
> Bootstrapped/regtested on x86_64-linux, ok for trunk?
I'd expect exactly the same cases to be diagnosed for the two attributes
on the same declaration, in either order, whether or not inside a single
__attribute__, as are diagnosed when multiple declarations are involved
(this applies to all such cases of invalid attribute combinations, not
just this one). Whether or not this patch achieves this, the testcase
doesn't seem to cover the case of a single declaration with both
attributes (and I don't see an existing such test in c-c++-common or
gcc.dg either).
--
Joseph S. Myers
joseph@codesourcery.com