This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Preliminary mainline patch for __attribute__ ((sentinel))
> [lots of examples...]
I have no doubt that you can find examples where NULL is an unadorned
zero, but the sentinel will warn about those. What I should have been
explicit about was in asking whether you can find a case where GCC's
sentinel warning will *silently* accept some NULL macro which is
actually problematic in the wild.
E.g. was any of those openbsd or freebsd platforms ever *released to
the public on 64-bit hardware* with NULL as 0 instead of 0L? Or were
the problems you cited discovered during development testing? If the
former, then you are entirely correct.
The C++ integer issue was already discussed here:
http://gcc.gnu.org/ml/gcc-patches/2004-08/msg02325.html
GCC will always warn about those and it is expected that the
programmer must use a cast.
> > Unless you can name one, I think #4 is busy-work with no
> > realizable benefit. (Note you'll have to change all users of
> > libiberty like GDB and BFD, not just GCC. I.e. anywhere we have
> > a call site for concat et al.)
>
> It's not a big problem. I have all the patches for gcc, and I can grab
> gdb and bfd and do them as well.
I'm really just curious. I have no objection at all to patching
concat, etc. if you don't mind the work. If you're going to proceed,
I suggest you resurrect NULL_PTR in ansidecl.h. Then you can use it
across all three projects.
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/include/ansidecl.h.diff?r1=1.9&r2=1.10
--Kaveh
--
Kaveh R. Ghazi ghazi@caip.rutgers.edu