Path: csiph.com!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!eternal-september.org!.POSTED!not-for-mail
From: Tim Rentsch
Newsgroups: comp.lang.c
Subject: Re: sizeof struct with flexible array: when did it change?
Date: Fri, 11 Apr 2025 04:53:48 -0700
Organization: A noiseless patient Spider
Lines: 16
Message-ID: <86bjt2c3sj.fsf@linuxsc.com>
References: <20241006192337.76@kylheku.com> <20250410200202.357@kylheku.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Injection-Date: Fri, 11 Apr 2025 13:53:52 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="71ab0539a1cf710e3caa6c34edacc1d7"; logging-data="1597659"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+sz3GY2xyDJs7C+JQGtoKoontyso6gUb4="
User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.4 (gnu/linux)
Cancel-Lock: sha1:p9Ve7y2gEtdb4YtCbjiG64/O4yQ= sha1:Ioa7upPHF5UvIWw2mldsxL7Vv2k=
Xref: csiph.com comp.lang.c:392376
Kaz Kylheku <643-408-1753@kylheku.com> writes:
> On 2024-10-07, Kaz Kylheku <643-408-1753@kylheku.com> wrote:
>
>> C99 said that the size of a structure that ends in a flexible array
>> member is the same as the offset of that flexible member in a
>> similar structure in which the array has some unspecified size.
>>
>> The latest draft says that the size is calculated as if the flexible
>> array member were omitted, except that there may be more padding than
>> the omission would imply.
>
> I just noticed that a draft version of C99 has exactly this
> same wording!
I am skeptical. Which document is that exactly?