Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 21 Aug 1998 20:50:37 -0500 (CDT)
From:      Phil Gilley <pgilley@metronet.com>
To:        freebsd-hackers@FreeBSD.ORG
Subject:   Stupidity or compiler bug?
Message-ID:  <Pine.HPP.3.95.980821204532.12165B-100000@fohnix.metronet.com>

next in thread | raw e-mail | index | archive | help
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 <stdio.h>
#include <netinet/in.h>
#include <netinet/in_systm.h>
#include <netinet/ip.h>
#include <arpa/inet.h>

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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.HPP.3.95.980821204532.12165B-100000>