🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

1 total messages Started by James Montebello Wed, 14 Oct 1992 17:37
Problems moving from GCC2.x to GCC1.x (yes, backwards)
#1211
Author: 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
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads