From 87ce6a064bc2a8df6d5fff26f09219420e03ab23 Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Tue, 25 Feb 2025 08:37:13 +0000 Subject: [PATCH] fixup! mingw: add a cache below mingw's lstat and dirent implementations Clang has newly developed an antipathy for unions and arrays of structs that contain flex arrays... Let's just pat clang's head and move on. Signed-off-by: Johannes Schindelin --- compat/win32/fscache.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/compat/win32/fscache.c b/compat/win32/fscache.c index 7f6214cc0a92e2..eb13ce35a58b6e 100644 --- a/compat/win32/fscache.c +++ b/compat/win32/fscache.c @@ -78,12 +78,15 @@ struct fsentry { }; #pragma GCC diagnostic pop +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wflexible-array-extensions" struct heap_fsentry { union { struct fsentry ent; char dummy[sizeof(struct fsentry) + MAX_LONG_PATH]; } u; }; +#pragma GCC diagnostic pop /* * Compares the paths of two fsentry structures for equality. @@ -596,7 +599,10 @@ void fscache_flush(void) int fscache_lstat(const char *filename, struct stat *st) { int dirlen, base, len; +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wflexible-array-extensions" struct heap_fsentry key[2]; +#pragma GCC diagnostic pop struct fsentry *fse; struct fscache *cache = fscache_getcache();