This is the mail archive of the gcc@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: error: "no newline at end of file"


Manuel López-Ibáñez wrote:

> Then, if the warnings are not very useful but are mandated by the
> standard, I think that the sensible thing is to make them conditional
> on -pedantic. This way, people wanting strict diagnostics for
> nonconformant code can get them, while people that don't care about it
> don't need to suffer even a warning.

I agree.

For diagnostics for issues which (a) probably do not indicate mistakes
on the part of the programmer, and (b) can be readily ignored by the
compiler, the idiomatic handling is:

  if (pedantic)
    pedwarn (...);

Thus, only users who want pedantic error messages see the message.  They
can control whether the message is an error or a warning via
-pedantic-errors (or the C++ front-end's -fpermissive).

-- 
Mark Mitchell
CodeSourcery
mark@codesourcery.com
(650) 331-3385 x713


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