bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

in-memory representation of NULL pointers?


From: Simon Josefsson
Subject: in-memory representation of NULL pointers?
Date: Fri, 23 Apr 2010 19:27:46 +0200
User-agent: Gnus/5.110011 (No Gnus v0.11) Emacs/23.1 (gnu/linux)

Not gnulib specific, but related to our coding style:

Does POSIX somewhere guarantee that the in-memory representation of NULL
pointers is 0?  I know that C89 doesn't make that guarantee, and that
some historic systems used non-0 memory values to represent NULL, but
I'm hoping that this is not permitted today by some standard.

I believe there is a bunch of places in gnulib which uses memset(P, 0,
sizeof(P)) to initialize structures containing pointers, which wouldn't
be OK if this is not the case.

/Simon




reply via email to

[Prev in Thread] Current Thread [Next in Thread]