This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.
| Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
|---|---|---|
| Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
| Other format: | [Raw text] | |
On Tue, Jun 23, 2009 at 11:12 AM, Joe Buck<Joe.Buck@synopsys.com> wrote:On Tue, Jun 23, 2009 at 12:43 AM, Alan Modra<amodra@bigpond.net.au> wrote:On Tue, Jun 23, 2009 at 12:35:48AM -0700, Gabriel Dos Reis wrote:..., but I think this warning should be in -Wc++-compat, not -Wall or even -Wextra. Why? I'd argue the warning is useless for C code, unless you care about C++ style.I do not think it is useless for C99 codes because C99 allows C++ style declarations/initialization in the middle of a block.But if the initialization is skipped and the variable is then used, won't we get an uninitialized-variable warning?
Did we get any in the cases Ian reported?
...
int a = ...;
if (a)
{
fail:
// does not use a
return;
}| Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
|---|---|---|
| Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |