From: Willy Tarreau Date: Tue, 9 Mar 2021 09:15:16 +0000 (+0100) Subject: BUILD: connection: do not use VAR_ARRAY in struct tlv X-Git-Tag: v2.4-dev12~65 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c93638e1d155f6419bca50daec42dcd370bae39f;p=thirdparty%2Fhaproxy.git BUILD: connection: do not use VAR_ARRAY in struct tlv It was brought by commit c44b8de99 ("CLEANUP: connection: Use `VAR_ARRAY` in `struct tlv` definition") but breaks the build with clang. Actually it had already been done 6 months ago by commit 4987a4744 ("CLEANUP: tree-wide: use VAR_ARRAY instead of [0] in various definitions") then reverted by commit 441b6c31e ("BUILD: connection: fix build on clang after the VAR_ARRAY cleanup") which explained the same thing but didn't place a comment in the code to justify this (in short it's just an end of struct marker). --- diff --git a/include/haproxy/connection-t.h b/include/haproxy/connection-t.h index 0c4a6649c8..8e0ee7d4b8 100644 --- a/include/haproxy/connection-t.h +++ b/include/haproxy/connection-t.h @@ -648,7 +648,7 @@ struct tlv { uint8_t type; uint8_t length_hi; uint8_t length_lo; - uint8_t value[VAR_ARRAY]; + uint8_t value[0]; // WT: don't use VAR_ARRAY here, it's an end of struct marker }__attribute__((packed)); struct tlv_ssl {