This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: PATCH RFA: -Wc++-compat warning about duplicate decls
- From: Dave Korn <dave dot korn dot cygwin at googlemail dot com>
- To: Robert Dewar <dewar at adacore dot com>
- Cc: Ian Lance Taylor <iant at google dot com>, gcc-patches at gcc dot gnu dot org
- Date: Sat, 20 Jun 2009 12:38:03 +0100
- Subject: Re: PATCH RFA: -Wc++-compat warning about duplicate decls
- References: <m3y6rnk9pi.fsf@google.com> <4A3C34BC.3020704@adacore.com>
Robert Dewar wrote:
> Ian Lance Taylor wrote:
>> In C, it's OK to write
>> int i;
>> int i;
>> In C++, it is not. This patch adds a -Wc++-compat warning for this
>> case. This patch requires approval from the C frontend maintainers.
>
> shouldn't this in any case generate a warning in C, how can
> it be useful to do this, regardless of C++ compatibility.
I don't understand. These are just uninitialised commons, aren't they? Why
would a C compiler warn about that?
cheers,
DaveK