Subject: Re: compiling -std=c99 on cobalt fails with alloca
To: Jason Thorpe <thorpej@shagadelic.org>
From: Kristaps Johnson <kristaps@gradient-enterprises.com>
List: port-cobalt
Date: 08/29/2006 15:15:07
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


>> But when compiled as such:
>>
>> $ gcc -std=c99 foo.c
>> /var/tmp//cc9lV8g8.o(.text+0x28): In function `main':
>> : undefined reference to `alloca'
>
> This is because alloca() is not in the C99 standard, and so GCC takes it 
> out of the namespace when you compile for C99 (alloca() is a built-in 
> GCC function; __builtin_alloca() should always work).

If NetBSD/cobalt (same with pmax - maybe all mipsel?) doesn't compile

$ gcc -std=c99 foo.c

(with the aforementioned alloca() call in foo.c)

...while NetBSD/i386 (and OpenBSD/i386, etc) does, then somebody has an 
error. I see that you've commented on this in the past; would you call 
this a bug on the other systems viz. conformance to c99?

On a related note, shouldn't this bail on compilation, and not on linking?

Take care,
   Kristaps

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (GNU/Linux)

iD8DBQFE9JJAK0ldVyV4920RAjcgAKDpHlexfT2ZxPsrqJMw+qp4yRG0KwCg4eFy
2y8h67AxvushsG+DxVLWYzQ=
=jXA6
-----END PGP SIGNATURE-----