alloca in function arguments (2.95.2)

Alexander V. Lukyanov lav@long.yar.ru
Sun Apr 9 06:48:00 GMT 2000


The following program does not produce the expected result.
Maybe this is a bug, maybe an alloca limitation. If it is
a limitation, a warning/error would be nice.

system: gcc-2.95.2, linux-i686, glibc-2.1.3.

#include <string.h>
#include <stdio.h>

void a(void *x,int y)
{
	printf("y=%d\n",y);
}

int main()
{
	a(strcpy(alloca(100),"abc"),1234);
	return 0;
}

   Alexander.


More information about the Gcc-bugs mailing list