From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28327 invoked by alias); 28 Feb 2002 17:29:27 -0000 Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org Received: (qmail 28253 invoked from network); 28 Feb 2002 17:29:22 -0000 Received: from unknown (HELO spinoza.ime.usp.br) (143.107.45.30) by sources.redhat.com with SMTP; 28 Feb 2002 17:29:22 -0000 Received: (qmail 10664 invoked from network); 28 Feb 2002 17:29:20 -0000 Received: from vila.linux.ime.usp.br (qmailr@192.168.240.9) by spinoza.linux.ime.usp.br with SMTP; 28 Feb 2002 17:29:20 -0000 Received: (qmail 5829 invoked from network); 28 Feb 2002 17:29:20 -0000 Received: from jacuzzi.linux.ime.usp.br (npaulo@192.168.240.15) by vila.linux.ime.usp.br with QMQP; 28 Feb 2002 17:29:20 -0000 Date: Thu, 28 Feb 2002 10:15:00 -0000 From: Nelson Guedes Paulo Junior To: John Love-Jensen cc: Andrea 'Fyre Wyzard' Bocci , snodx@hotmail.com, gcc-help@gcc.gnu.org Subject: Re: IP ADDRESS OF MACHINE In-Reply-To: <3C7E38FB.794E2217@adobe.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=ISO-8859-1 Content-Transfer-Encoding: QUOTED-PRINTABLE X-SW-Source: 2002-02/txt/msg00309.txt.bz2 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. ----- Nelson Guedes Paulo Junior=20=20=20 E-mail: UIN: 2489382 (Tender [:alpha:]*) "LAPTOPirose =E9 a doen=E7a causada pela urina do mouse" On Thu, 28 Feb 2002, John Love-Jensen wrote: > Hi Nelson, >=20 > Change the one line to... > typedef unsigned char byte; > printf ("address: %hhu.%hhu.%hhu.%hhu\n", \ > (*entry)[0] & 0xFF, > (*entry)[1] & 0xFF, > (*entry)[2] & 0xFF, > (*entry)[3] & 0xFF); >=20 > What you are seeing is an octet being treated as signed, and the signed > extension value being displayed as an unsigned int. >=20 > The mask will slice the sign extended high-bits off properly. >=20 > --Eljay >=20 >=20 >=20