This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: IP ADDRESS OF MACHINE
- From: Andrea 'Fyre Wyzard' Bocci <fwyzard at inwind dot it>
- To: Nelson Guedes Paulo Junior <npaulo at linux dot ime dot usp dot br>,John Love-Jensen <eljay at adobe dot com>
- Cc: snodx at hotmail dot com,gcc-help at gcc dot gnu dot org
- Date: Fri, 01 Mar 2002 00:58:45 +0100
- Subject: Re: IP ADDRESS OF MACHINE
- References: <3C7E38FB.794E2217@adobe.com>
At 14.29 28/02/2002 (GMT -0300), Nelson Guedes Paulo Junior wrote:
>Hi Eljay,
>
>Thanks for helping, but did you, or others now how the program could work
>without this patch on fwyzard's machine like her described?
>
>If you put a cast to (unsigned char) in fornt of some (*entry)[0] you get
>the correct results too, but why in her's machine this works whitout any
>patch? Is this a portable solution?
>
>Thanks.
Hi Nelson
Casting to (unsigned char) works, and is the most portable solution, I'm
quite sure, while using %hhu in printf is very dependent on the C library
you happen to use.
I used glibc 2.2.4, but many other or older libraries do not support that.
BTW, I don't think the behaviour depends on the compiler version, anyway, I
used both gcc 2.96 (from Red Hat) and gcc 3.0.2.
fwyzard
P.S.
In Italy, Andrea happen to be a mostly male name - so I'm a "him" not a
"her" :-)