Subject: Re: compiling -std=c99 on cobalt fails with alloca
To: None <port-cobalt@NetBSD.ORG>
From: Christopher Schultz <chris@christopherschultz.net>
List: port-cobalt
Date: 08/29/2006 15:40:13
This is an OpenPGP/MIME signed message (RFC 2440 and 3156)
--------------enigF14CA9FABB8A55FFCE2C1FD0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

Kristaps,

>>>> $ gcc -std=3Dc99 foo.c
>>>> /var/tmp//cc9lV8g8.o(.text+0x28): In function `main':
>>>> : undefined reference to `alloca'

[snip]

> On a related note, shouldn't this bail on compilation, and not on linki=
ng?

Nope. The compiler should issue an "implicit declaration" warning (if
you have warnings turned on) for an missing function, but it's the
linker that will bomb because it can't resolve the reference at all.

It looks like when you use -std=3Dc99, it simply ignores the fact that
"alloca" exists in the (non)standard library, and assumes that you are
trying to use your own method that just happens to be called "alloca".

-chris


--------------enigF14CA9FABB8A55FFCE2C1FD0
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFE9Jgd9CaO5/Lv0PARAmZRAJ9RpY8uLGLpSnHBZEpW6oF9EM1rVwCguoiL
0qeIHk+6mRju2DSRqY+tCSs=
=R7RC
-----END PGP SIGNATURE-----

--------------enigF14CA9FABB8A55FFCE2C1FD0--