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]

Re: [C PATCH] Implement -Wc90-c99-compat (PR c/51849)

On Thu, Aug 07, 2014 at 05:10:43PM +0000, Joseph S. Myers wrote:
> On Thu, 31 Jul 2014, Marek Polacek wrote:
> > A few issues: currently we don't warn (in -std=c90 -pedantic mode)
> > about the usage of __func__ and _Pragma (possible others - va_copy?).
> > I'm hoping this is not that important though.  For restrict/inline,
> > in GNU90 mode we just don't compile the code at all (unless we use
> > __restrict and similar), and -Wc90-c99-compat does not warn about those.
> And, -pedantic -Wno-c90-c99-compat - outside C99 mode - doesn't disable 
> the relevant warnings (I'd think of it as logically like -pedantic 
> -Wno-long-long, so it should disable them, while leaving all the -pedantic 
> diagnostics for features that aren't in C99).  Though I think implementing 
> that could reasonably be a followup fix.
> E.g., in C90 mode, -Wlong-long is more specific than -Wc90-c99-compat, 
> which is more specific than -pedantic.  So the "long long" warnings should 
> be determined by any explicit -W(no-)long-long if given, otherwise by any 
> -W(no-)c90-c99-compat if given, otherwise by -pedantic, following the 
> general rule of the most specific option taking precedence (and 
> command-line order only being relevant when multiple variants of the same 
> option are used, e.g. -Wlong-long -Wno-long-long).  Outside C90 mode, 
> -pedantic is irrelevant to such warnings; -W(no-)long-long should take 
> precedence over -W(no-)c90-c99-compat if both are used.  For warnings 
> without a more specific option such as -Wlong-long, of course it's a bit 
> simpler.

Yeah, makes sense.  I just finished testing a patch that implements
the above; will post it momentarily.

> "a specific option".
> OK with that change.

Fixed, thanks for reviewing this.


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