This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [C PATCH] Don't output warning twice (PR c/63626)
- From: "Joseph S. 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: Thu, 23 Oct 2014 16:39:26 +0000
- Subject: Re: [C PATCH] Don't output warning twice (PR c/63626)
- Authentication-results: sourceware.org; auth=none
- References: <20141023112844 dot GJ10501 at redhat dot com>
On Thu, 23 Oct 2014, Marek Polacek wrote:
> At present, we print the "inline function ... declared but never
> defined" warning twice. The reason for that is that this warning
> is being printed in pop_scope, which is called when popping file
> scope (c_common_parse_file->pop_file_scope), and when popping
> external scope (c_write_global_declarations). I think we should
> not print this warning when popping the external scope.
> We don't have to worry about nested functions here.
>
> Writing a proper testcase is a little bit tricky, but I hope what
> I did would work fine.
>
> Bootstrapped/regtested on x86_64-linux, ok for trunk?
>
> 2014-10-23 Marek Polacek <polacek@redhat.com>
>
> PR c/63626
> * c-decl.c (pop_scope): Don't print warning in external_scope.
>
> * gcc.dg/pr63626.c: New test.
OK.
--
Joseph S. Myers
joseph@codesourcery.com