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: [C++ patch] accept __null as sentinel


Hi,

On Fri, 29 Apr 2005, Joseph S. Myers wrote:

> One possibility in that regard is for it to go in -Wformat=2 alongside
> -Wformat-nonliteral -Wformat-security -Wformat-y2k.  Though unlike
> --Wformat-nonliteral -Wformat-y2k which are cases where the warning can
> be difficult to avoid (if your code needs to build up a format string,
> or if you know you do want a particular strftime format) so indicating
> it doesn't belong in -Wall, here the warning can always be avoided by
> adding a cast at each call site (with no change to the code generated).  

This indicates that you never had to deal with more than a couple sources,
whose initial author is long dead ;-)  This would shift needless
maintenance work (and "adding a cast at each call site" can be quite much)  
on the shoulders of maintainers.  If the author is interested in
portability, well, there's -pedantic.  Let's keep -Wall usable and not
force people to do "-W -Wall -Wno-not-this-one -Wno-thats-dumb-too
-Wno-cant-break-anything" to get at the usefull warnings.

A criteria for usefull warnings _to me_ (I fully realize that's not the
opinion of all), is "can it change code harmfully depending on the
architecture or circumstances, when compiled on a GNU system".  To a
lesser extent it's also important if the warning can be easily avoided.  
To an even lesser extent it's important if users can use GCC to check code
for compatibility to other non-GNU systems.  If the last point conflicts
with my primary one, then it has to be requested by a user with a special
directive.  As we have no -Wportability-to-non-gnu (in difference to
portability to different architectures/ABIs), -pedantic it is.


Ciao,
Michael.


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