Pradeep Kumar wrote:[color=blue]
> Hi all,
> does anyone know the gcc equvalent of hp c compiler's -z option
> thx
>[/color]
You already posted this question in at least one other
newsgroup. Please do so only if the request is topical
in the respective newsgroups (which it is not round here)
and, if you do so, crosspost instead of multiple separate
posts -- this causes less work to the people you ask and
avoids essentially equal replies from different people in
different newsgroups.
Cheers
Michael
--
E-Mail: Mine is an /at/ gmx /dot/ de address.
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
On 2005-12-01, Pradeep Kumar <mbpradeep@gmai l.com> wrote:[color=blue]
> 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
>[/color]
You should've posted your question to comp.sys.hp.hpu x, 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>gnuli nux<dot>nl''
.... but I'm not speaking for the Software Libre Foundation!
On 30 Nov 2005 23:53:47 -0800, in comp.lang.c , "Pradeep Kumar"
<mbpradeep@gmai l.com> wrote:
[color=blue]
>f compiled with this option, program errors out at any usage of NULL
>pointers. The man page for hp cc is below[/color]
Terriffic. Did you actually understand what Michael wrote?
--
Mark McIntyre
CLC FAQ <http://www.eskimo.com/~scs/C-faq/top.html>
CLC readme: <http://www.ungerhu.com/jxh/clc.welcome.txt >
----== Posted via Newsfeeds.Com - Unlimited-Unrestricted-Secure Usenet News==---- http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =----
Comment