This is the mail archive of the 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]

Wold-style-declaration (PR7651 Define -Wextra strictly in terms of other warning flags)


This patch continues the effort to fix PR7651 [1].

A new option -Wold-style-declaration takes over the warning about
storage-class specifiers like "static" that are not the first things
in a declaration. I have generalized the description a bit more, so it
could encompass any other obsolescent usage in a declaration. This
patch also updates the documentation to reflect that the warning only
applies to C. The new option is enabled by -Wextra, so we keep the
current behaviour but add the ability to enable/disable this
individual warning.

Bootstrapped and regression tested with --enable-languages=all on

OK for mainline?


2006-12-29 Manuel Lopez-Ibanez <>

 PR middle-end/7651
 * c.opt (Wold-style-declaration): New.
 * doc/invoke.texi (C-only Warning Options): New.
 (Wold-style-declaration): Document it.
 (Wextra): Enabled by -Wextra.
 * c-opts.c (c_common_post_options): Enabled by -Wextra.
 * c-decl.c (declspecs_add_scspec): Replace -Wextra with

2006-12-29  Manuel Lopez-Ibanez  <>

 PR middle-end/7651
 * gcc.dg/declspec-3.c: Replace -W with -Wold-style-declaration.
 * gcc.dg/declspec-3-Wextra.c: New.
 * gcc.dg/declspec-3-no.c: New

Attachment: wold-style-declaration.diff
Description: Text document

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]