oidtree: avoid nested struct oidtree_node
commit14825944d7c57b6acd7e1a05a4c6046965efc6a5
authorCarlo Marcelo Arenas Belón <carenas@gmail.com>
Mon, 9 Aug 2021 01:38:31 +0000 (8 18:38 -0700)
committerJunio C Hamano <gitster@pobox.com>
Mon, 9 Aug 2021 16:01:30 +0000 (9 09:01 -0700)
tree2f2bc32f1bbc37aea6ebf24d9cf8fca9ce9c2848
parent92d8ed8ac101d62183d51f280b90efb1de1bda5c
oidtree: avoid nested struct oidtree_node

92d8ed8ac1 (oidtree: a crit-bit tree for odb_loose_cache, 2021-07-07)
adds a struct oidtree_node that contains only an n field with a
struct cb_node.

unfortunately, while building in pedantic mode witch clang 12 (as well
as a similar error from gcc 11) it will show:

  oidtree.c:11:17: error: 'n' may not be nested in a struct due to flexible array member [-Werror,-Wflexible-array-extensions]
          struct cb_node n;
                         ^

because of a constrain coded in ISO C 11 6.7.2.1¶3 that forbids using
structs that contain a flexible array as part of another struct.

use a strict cb_node directly instead.

Signed-off-by: Carlo Marcelo Arenas Belón <carenas@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
oidtree.c