Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 7 Mar 2002 03:13:41 +0000
From:      Tony Finch <dot@dotat.at>
To:        freebsd-hackers@freebsd.org
Subject:   Re: A few questions about a few includes
Message-ID:  <20020307031341.C19669@chiark.greenend.org.uk>
In-Reply-To: <44henw2hqp.fsf@lowellg.ne.mediaone.net>

next in thread | previous in thread | raw e-mail | index | archive | help
Lowell Gilbert <lowell@world.std.com> wrote:
>
>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.]

Although there has been some discussion in the committee about allowing
zero-sized objects in C, the standard doesn't allow them. This is perhaps
why it doesn't follow gcc's [0] syntax for variable length arrays at the
end of structures.

Tony.
-- 
f.a.n.finch <dot@dotat.at>
THAMES DOVER WIGHT PORTLAND PLYMOUTH: WEST OR SOUTHWEST 5 TO 7 DECREASING 4.
DRIZZLE DYING OUT. MODERATE, OCCASIONALLY POOR, BECOMING GOOD.

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?20020307031341.C19669>