This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
IRIX64 6.5, gcc 2.95.1: weird inet_ntoa() behaviour
- To: gcc at gcc dot gnu dot org
- Subject: IRIX64 6.5, gcc 2.95.1: weird inet_ntoa() behaviour
- From: Denis Vakatov <vakatov at peony dot nlm dot nih dot gov>
- Date: Wed, 24 May 2000 10:51:32 -0400 (EDT)
- CC: vakatov at peony dot nlm dot nih dot gov, lavr at peony dot nlm dot nih dot gov
Hi,
See the attached code:
inet_ntoa() produces an invalid result when the following code
compiled with GCC.
However, it produces a correct result when compiled with native "cc".
?
Denis Vakatov
Anton Lavrentiev
-----------------------------------------------------------------------------
> uname -a
IRIX64 muncher 6.5 10181058 IP27
> gcc --version
2.95.1
> cat - > inet_ntoa.c
#include <net/if.h>
#include <arpa/inet.h>
#include <netinet/in.h>
#include <stdio.h>
int main(void)
{
struct sockaddr_in sin;
sin.sin_family = AF_INET;
sin.sin_port = 0x1234;
sin.sin_addr.s_addr = 0x820E1923;
printf("%s\n", inet_ntoa(sin.sin_addr));
return 0;
}
> gcc inet_ntoa.c
> a.out
255.255.255.255
> cc inet_ntoa.c
> a.out
130.14.25.35