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: diagnostic.c reorganization

"Joseph S. Myers" <> writes:

| On Sun, 11 May 2003, Zack Weinberg wrote:
| > How's this text?
| > 
| >    A pedantic warning.  The effect is the same as "warning" unless
| >    -pedantic-errors was given on the command line, which elevates the
| >    severity to "error".  Use this for any diagnostic which is required
| >    by the relevant language standard, but which is not to be an error.
| > 
| >    There are two subcategories of pedantic warnings: mandatory and
| >    optional.  Mandatory pedwarns are for code which is definitely
| >    wrong per the standard, but the programmer's intent is clear, so
| >    the code can still be compiled.  Optional pedwarns are for code
| >    where the standard's requirement is considered too restrictive.
| > 
| >    Just calling pedwarn produces a mandatory pedwarn; to get an
| >    optional pedwarn, write "if (pedantic) pedwarn (...);".
| It looks correct,

I do not agree -- see my other message.

| except for the peculiarity of mandatory pedwarns being
| errors by default in C++.  I'm not sure of the rationale for the 
| difference (a documented change in 2.95: (from cp/NEWS)

The rationale is that, C++ is much more picky than C (mostly on the
type system side) and there were many things that were just pedwarn
(like implicit int for the baisc case, and other "monstruosities"
like implicit typename for the advanced case) where we could actually
generated wrong code.  They were made mandatory pedwarns so as to give
users time to do the migration. 

-- Gaby

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