This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch c-family]: Fix Bug 35330 - [4.8/4.9/5 regression] ICE with invalid pragma weak
- From: Marek Polacek <polacek at redhat dot com>
- To: Kai Tietz <ktietz70 at googlemail dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Fri, 27 Feb 2015 11:32:32 +0100
- Subject: Re: [patch c-family]: Fix Bug 35330 - [4.8/4.9/5 regression] ICE with invalid pragma weak
- Authentication-results: sourceware.org; auth=none
- References: <CAEwic4YgnSikw_8vnPH4Z0_6jCniMMa+QKDT6xgbT=C5H37r0A at mail dot gmail dot com> <20150226185301 dot GI22272 at redhat dot com> <CAEwic4YQ7wDM9SWoPohwigxP=D+Jb7rop0BNGiiyu0TDmUzaag at mail dot gmail dot com>
On Thu, Feb 26, 2015 at 09:25:57PM +0100, Kai Tietz wrote:
> Well, testcase for the pragma ...
>
> ChangeLog testsuite/
>
> 2015-02-26 Kai Tietz <ktietz@redhat.com>
>
> * gcc.dg/weak/weak-17.c: New file
Missing full stop.
> Updated patch (regression-tested):
> Index: c-pragma.c
> ===================================================================
> --- c-pragma.c (Revision 221019)
> +++ c-pragma.c (Arbeitskopie)
> @@ -392,6 +392,8 @@ handle_pragma_weak (cpp_reader * ARG_UNUSED (dummy
> decl = identifier_global_value (name);
> if (decl && DECL_P (decl))
> {
> + if (!VAR_OR_FUNCTION_DECL_P (decl))
> + GCC_BAD2 ("weak declaration of %q+D not allowed, ignored", decl);
I think this message should explicitly mention "#pragma weak".
Ok with those changes.
Marek