This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: IP ADDRESS OF MACHINE


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" :-)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]