On 2005-12-01, Pradeep Kumar <mb*******@gmail.com> wrote:
f compiled with this option, program errors out at any usage of NULL
pointers. The man page for hp cc is below
(Please note that we cannot use ElectricFence tool here for my work)
// portion of man page start
-z Do not bind anything to address zero. This option
allows runtime detection of null pointers. See the
note on pointers below.
// man page portion end
You should've posted your question to comp.sys.hp.hpux, where it would
have been topical. I'm not quite sure what you're asking because last I
checked, gcc on HP-UX disabled dereferencing null pointers by default,
that is it behaved like HP's compiler if invoked with -z. If you really
wish to enable mapping of address zero, you can use the chatr program to
do this with gcc generated binaries;
gcc prog.c -o prog
chatr +z prog
Disable it with
chatr -z prog
Note that most systems provide no way to map anything at address zero so
your program will not work on them if it relies on this feature. Save
yourself the headache and always treat null pointers as unmapped.
--
Nils R. Weller, Bremen (Germany)
My real email address is ``nils<at>gnulinux<dot>nl''
.... but I'm not speaking for the Software Libre Foundation!