Skip site navigation (1)Skip section navigation (2)
Date:      04 Mar 2002 15:35:58 -0500
From:      Lowell Gilbert <lowell@world.std.com>
To:        freebsd-hackers@freebsd.org
Subject:   Re: A few questions about a few includes
Message-ID:  <44henw2hqp.fsf@lowellg.ne.mediaone.net>
In-Reply-To: <20020304174200.X74223-100000@beagle.fokus.gmd.de>
References:  <20020304174200.X74223-100000@beagle.fokus.gmd.de>

next in thread | previous in thread | raw e-mail | index | archive | help
Harti Brandt <brandt@fokus.gmd.de> writes:

> This should be
> 
> struct foo {
> 	char array[];
> };
> 
> according to C-99, on which gcc2 barfs. Don't know, whether gcc3 can
> handle this.

C-99 requires a fully specified type before the unspecified array (and
requires said array to be the last element in the structure).  So this
example is *not* valid in C99, but the following would be:

struct foo {
        int bar;
        char array[];
};

[Which makes sense; it forces a structure to have a non-zero size.]

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?44henw2hqp.fsf>