Sujet : Re: sizeof struct with flexible array: when did it change?
De : tr.17687 (at) *nospam* z991.linuxsc.com (Tim Rentsch)
Groupes : comp.lang.cDate : 07. Oct 2024, 04:43:52
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <86y130zifb.fsf@linuxsc.com>
References : 1
User-Agent : Gnus/5.11 (Gnus v5.11) Emacs/22.4 (gnu/linux)
Kaz Kylheku <
643-408-1753@kylheku.com> writes:
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.
The change was made in a TC to C99, sometime in the early
2000s. (No I don't know which TC specifically, but the
wording change can be seen in N1256.)