This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [C++ patch] accept __null as sentinel
Hi,
On Fri, 29 Apr 2005, 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.
Most definitely. I never proposed to deactivate this warning _except_ for
the very narrow case of accepting __null also. Actually the usefullness
of that warning only made us add the attribute to quite some common
headers, and then we noticed that many C++ packages broke without the
patch.
> 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 was my mode of thinking. I.e. I basically will do this:
&& (warn_null_strict || null_node != TREE_VALUE (sentinel))
Ciao,
Michael.