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

Re: diagnostic.c reorganization


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, 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)

*** Changes in GCC 2.95:
  
* Messages about non-conformant code that we can still handle ("pedwarns")
  are now errors by default, rather than warnings.  This can be reverted
  with -fpermissive, and is overridden by -pedantic or -pedantic-errors.
  
).

-- 
Joseph S. Myers
jsm28@cam.ac.uk


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