🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: comp.sys.next.programmer
2 messages
2 total messages Started by Ralf E. Stranzenbach Tue, 07 Apr 1992 08:48
NeXT-cc bug report
#558
Author: Ralf E. Stranzenbach
Date: Tue, 07 Apr 1992 08:48
22 lines
918 bytes
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.

	- ralf

--
Ralf E.Stranzenbach  -   (NeXT)-Mail: ralf@reswi.en.open.de
                                Fido: via 2:245/5800.12
                       (Voice)-Phone: +49 2302 / 68403
--
In jedem grossen Problem steckt ein kleines, das gerne raus will.
Re: NeXT-cc bug report
#613
Author: 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.
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