🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.next.programmer
Article #613

Re: NeXT-cc bug report

#613
From: Alex Senkevitch
Date: Wed, 08 Apr 1992 18:35
31 lines
1150 bytes
In article <1992Apr7.084848.29747@reswi.en.open.de> ralf@reswi.en.open.de (Ralf  
E. Stranzenbach) writes:
> Hi,
> 
> the following code fragment did _not_ compile properly:
> 
> 	void some_function (char * s)
> 	{
> 		char * d;
> 		d = strcpy (alloca (strlen (s) + 1), s);
> 		printf ("%s copied as %s\n", s, d);
> 	}
> 
> There are some problems using "alloca" as part of a functions  
> parameter list.

try this:

void some_function(char *s) {
	char *d;

	strcpy((d=(char*)malloc(strlen(s)+1)),s);
	printf("%s copied as %s\n", s, d);
}

Also, make sure you have the proper libraries and header files included into  
your makefile and .c file.

J. Alexander Jamison
Sr. Systems Engineer
Talus Imaging and Communications Corp.
Technical Details
Message-ID: <1992Apr8.183539.1868@talus.com>
Path: arc1-ca.pugleaf.net!sparky!news.UU.NET!olivea!sgigate!psinntp!psinntp!talus!ajamison
References: <1992Apr7.084848.29747@reswi.en.open.de>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!news.UU.NET!olivea!sgigate!psinntp!psinntp!talus!ajamison
From: ajamison@talus.com (Alex Senkevitch)
Newsgroups: comp.sys.next.programmer
Subject: Re: NeXT-cc bug report
Message-ID: <1992Apr8.183539.1868@talus.com>
Date: 8 Apr 92 18:35:39 GMT
References: <1992Apr7.084848.29747@reswi.en.open.de>
Sender: ajamison@talus.com
Organization: Talus Corporation
Lines: 31