From owner-freebsd-hackers Fri Aug 21 18:50:26 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id SAA03930 for freebsd-hackers-outgoing; Fri, 21 Aug 1998 18:50:26 -0700 (PDT) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from metronet.com (fohnix.metronet.com [192.245.137.2]) by hub.freebsd.org (8.8.8/8.8.8) with SMTP id SAA03911 for ; Fri, 21 Aug 1998 18:50:23 -0700 (PDT) (envelope-from pgilley@metronet.com) Received: from localhost by metronet.com with SMTP id AA19108 (5.67a/IDA1.5hp for ); Fri, 21 Aug 1998 20:50:37 -0500 Date: Fri, 21 Aug 1998 20:50:37 -0500 (CDT) From: Phil Gilley To: freebsd-hackers@FreeBSD.ORG Subject: Stupidity or compiler bug? Message-Id: Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Am I doing something really stupid here or is this a compiler bug? The output of this program under 2.2.7-RELEASE is "1.2.3.4 1.2.3.4" which isn't what I was expecting. "1.2.3.4 5.6.7.8" is what I was hoping for. #include #include #include #include #include void main() { struct ip iph; iph.ip_src.s_addr = ntohl(0x01020304); iph.ip_dst.s_addr = ntohl(0x05060708); printf("%s %s\n", inet_ntoa(iph.ip_src), inet_ntoa(iph.ip_dst)); } Phil Gilley pgilley@metronet.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message