]> git.ipfire.org Git - thirdparty/git.git/commit
FLEX_ARRAY: require platforms to support the C99 syntax
authorJunio C Hamano <gitster@pobox.com>
Fri, 12 Dec 2025 12:54:14 +0000 (21:54 +0900)
committerJunio C Hamano <gitster@pobox.com>
Fri, 12 Dec 2025 13:05:19 +0000 (22:05 +0900)
commit4d75f2aea776f434b51481ae65233d6012da1a66
tree98d0fd5f779697e72b6370adcffd8510e33bef24
parente85ae279b0d58edc2f4c3fd5ac391b51e1223985
FLEX_ARRAY: require platforms to support the C99 syntax

Before C99 syntax to express that the final member in a struct is an
array of unknown number of elements, i.e.,

struct {
...
T flexible_array[];
};

came along, GNU introduced their own extension to declare such a
member with 0 size, i.e.,

T flexible_array[0];

and the compilers that did not understand even that were given a way
to emulate it by wasting one element, i.e.,

T flexible_array[1];

As we are using more and more C99 language features, let's see if
the platforms that still need to resort to the historical forms of
flexible array member support are still there, by forcing all the
flex array definitions to use the C99 syntax and see if anybody
screams (in which case reverting the changes is rather easy).

Signed-off-by: Junio C Hamano <gitster@pobox.com>
git-compat-util.h