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++] warn if NULL is passed through varargs


On Oct 10, 2002, Michael Matz <matz@suse.de> wrote:

> A compiler (or library header) which defines NULL for C (which has to be a
> pointer) to just 0 on such a machine is broken.

grep '#define NULL' /usr/include/*.h reveals a number of programs that
define NULL to 0, at least when NULL isn't previously defined, which
is possible if you #include say <expect.h> or <tcl.h> before
<stddef.h>.

Of course, such mis-definitions wouldn't take any benefit from the
warnings in the first place, since the warning could only possibly
trigger if gcc gets to define NULL the way it can track where it's
used inappropriately.

-- 
Alexandre Oliva   Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer                 aoliva@{redhat.com, gcc.gnu.org}
CS PhD student at IC-Unicamp        oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist                Professional serial bug killer


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