This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [C PATCH] Warn for optimize attribute on decl after definition (PR c/70255)
- 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>, Richard Biener <rguenther at suse dot de>
- Date: Mon, 9 May 2016 22:15:40 +0000
- Subject: Re: [C PATCH] Warn for optimize attribute on decl after definition (PR c/70255)
- Authentication-results: sourceware.org; auth=none
- References: <20160509144510 dot GA20450 at redhat dot com>
On Mon, 9 May 2016, Marek Polacek wrote:
> In this PR, Richi pointed out that we don't warn for the case when a
> declaration with attribute optimize follows the definition which is lacking
> that attribute. This patch adds such a warning. Though the question is
> whether this shouldn't apply to more attributes than just "optimize". And,
> as can be seen in the testcase, we'll warn for even for the case when the
> definition has
> optimize ("no-associative-math,O2")
> and the declaration
> optimize ("O2,no-associative-math")
> Not sure if we have something better than attribute_value_equal, though.
>
> (The C++ FE lacks these kind of warnings; I opened PR71024 for that.)
>
> Bootstrapped/regtested on x86_64-linux, ok for trunk?
OK.
--
Joseph S. Myers
joseph@codesourcery.com