🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gcc.bug
Article #1211

Problems moving from GCC2.x to GCC1.x (yes, backwards)

#1211
From: James Montebello
Date: Wed, 14 Oct 1992 17:37
43 lines
1971 bytes
The included file compiles and links fine with both GCC 1.42 and 2.2.2.
on a SS2 running 4.1.1.

However, when run, I get a Bus Error in inet_netof() in the executable
compiled with 1.42, while the 2.2.2 version runs and works fine. GDB
claims that the input struct 'myip' is identical in both cases. I've
checked the include files used by both and they look OK (I've even
tried using the 2.2.2 "fixed" includes with the 1.42 compiler). I
haven't yet looked at the assembled output, but I have no experience
with SPARC code, so that would probably prove fruitless. 

You may say, "So? Use the 2.2.2 version." I would, except that nifty
tool Purify doesn't work with 2.x objects, only 1.x objects, and I
*really* want to "purify" the application that contains this fragment.

What's up here?


#include <stdio.h>
#include <malloc.h>

#include <sys/types.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <netdb.h>

main(int ac, char **av)
{
    struct hostent *he;
    struct in_addr myip;
    unsigned int netp;
	
    he = gethostbyname(av[1]);	/* name of this host expected as 1st parm */

	memset(&myip,'\0',sizeof(struct in_addr));
    memcpy(&myip.s_addr, he->h_addr_list[0], sizeof(myip.s_addr));
    netp = inet_netof(myip);	/* kaboom */
}
-- 
------------------------------------------------------------------------
james montebello (james@bridge.com)         'my employer has no opinions'		
Experience: a comb life gives you after you lose your hair.
	- Judith Stern
Technical Details
Message-ID: <1178@racerx.bridge.COM>
Path: arc1-ca.pugleaf.net!sparky!uunet!convex!linac!pacific.mps.ohio-state.edu!cis.ohio-state.edu!racerx.UUCP!james

Show Full Headers
Complete Article Headers
Newsgroups: gnu.gcc.bug
Path: arc1-ca.pugleaf.net!sparky!uunet!convex!linac!pacific.mps.ohio-state.edu!cis.ohio-state.edu!racerx.UUCP!james
From: james@racerx.UUCP (James Montebello)
Subject: Problems moving from GCC2.x to GCC1.x (yes, backwards)
Message-ID: <1178@racerx.bridge.COM>
Sender: gnulists@ai.mit.edu
Organization: Bridge Information Systems
Distribution: gnu
Date: Wed, 14 Oct 1992 17:37:13 GMT
Approved: bug-gcc@prep.ai.mit.edu
Lines: 44