This is the mail archive of the
mailing list for the GCC project.
C/C++ diagnostics guidelines (was: Re: [C PATCH] Enable initializing statics with COMPOUND_LITERAL_EXPR in C99 (PR c/63567))
- From: Manuel López-Ibáñez <lopezibanez at gmail dot com>
- To: Gcc Patch List <gcc-patches at gcc dot gnu dot org>, "Joseph S. Myers" <joseph at codesourcery dot com>, Marek Polacek <polacek at redhat dot com>, Paolo Carlini <paolo dot carlini at oracle dot com>, Jason Merrill <jason at redhat dot com>, Dodji Seketeli <dodji at redhat dot com>, Jonathan Wakely <jwakely dot gcc at gmail dot com>
- Date: Fri, 17 Oct 2014 19:03:55 +0200
- Subject: C/C++ diagnostics guidelines (was: Re: [C PATCH] Enable initializing statics with COMPOUND_LITERAL_EXPR in C99 (PR c/63567))
- Authentication-results: sourceware.org; auth=none
> The Right Thing is for -pedantic not to cause errors, only warnings
> (-pedantic-errors being needed for an error). So rather than having this
> conditional for whether to allow the extension at all, make the
> conditional code do a pedwarn (if flag_isoc99, otherwise there will
> already have been one for using a compound literal at all, and not for
> VECTOR_TYPE). (I don't believe this can affect the semantics of valid
> code; in this case of require_constant with a compound literal, we know
> the code is invalid in ISO C terms, so it's safe to diagnose it then
> interpret it in a sensible way.)
I think there is roughly consensus about how C/C++ diagnostics should
work, but it is easy to forget it since it is not really written
Thus, I drafted some guidelines
Please, could you take a look and comment whether I got it right/wrong?
New items are very welcome!