Subject: Re: compiling -std=c99 on cobalt fails with alloca
To: Kristaps Johnson <email@example.com>
From: Jason Thorpe <firstname.lastname@example.org>
Date: 08/29/2006 13:12:49
On Aug 29, 2006, at 12:15 PM, Kristaps Johnson wrote:
> 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?
Historically, some of NetBSD's platforms had an alloca(3)
implementation in libc. However, those implementations aren't even
really used anymore because GCC prefers its built-in (which is good --
alloca() really needs to cooperate with the compiler).
(On a related note, we should probably put a __warn_references on the
libc alloca() implementation to get a warning at link-time if the libc
version gets used by a program.)
> On a related note, shouldn't this bail on compilation, and not on
It would if you had -Wstrict-prototypes -Wmissing-prototypes -Werror,
because the alloca() prototype is not in-scope.