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


Kaveh R. Ghazi wrote:

I would prefer that at least some form of sentinel checking be done in
plain -Wall/-Wformat, because most people won't know to use a special
flag to get the new sentinel checking, so the vast majority of users
won't see any benefit from this new warning.

How about if the default -Wall/-Wformat behavior check for sentinels
but in the lenient fashion Michael proposes i.e. allowing __null.  And
-Wformat=2 (or some extra flag) is more strict, i.e. disallows __null.

That would ensure -Wall would continue to be useful but not complain
about the NULL macro for people confined to GNU systems, while still
providing a way for those interested in porting to systems where NULL
is 0.

Sound okay?

Yes, that's what I meant to suggest. I don't think anyone wants to drop checking for sentinels in -Wall; it's just the special case of passing "__null" as a sentinel that's an issue.


--
Mark Mitchell
CodeSourcery, LLC
mark@codesourcery.com
(916) 791-8304


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