[cfe-dev] gcc quirk not implemented

Roman Divacky rdivacky at freebsd.org
Wed Oct 22 03:29:54 PDT 2008


On Tue, Oct 21, 2008 at 09:00:34AM -0700, Eli Friedman wrote:
> On Tue, Oct 21, 2008 at 6:36 AM, Roman Divacky <rdivacky at freebsd.org> wrote:
> > hi
> >
> > gcc accepts this code:
> >
> > int
> > __xuname(int namesize, void *namebuf)
> > {
> >        struct xutsname {
> >                char    sysname[namesize];      /* Name of this OS. */
> >        } *name;
> > }
> >
> > which clang refuses with:
> >
> > const.c:5:25: error: arrays with static storage duration must have constant integer length
> >                char    sysname[namesize];      /* Name of this OS. */
> >                                        ^~~~~~~
> >
> > note that this violates C99 but obviously it's used (for example in freebsd libc code)
> > so I believe it should get implemented.
> 
> Thanks for the report; please file in Bugzilla so it doesn't get lost.
>  Looks like a serious pain to implement (structs with multiple
> variable-sized members, anyone?), but I guess that's gcc compat.

http://llvm.org/bugs/show_bug.cgi?id=2930



More information about the cfe-dev mailing list