Skip to content

Commit

Permalink
fixup! mingw: add a cache below mingw's lstat and dirent implementations
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
dscho committed Feb 25, 2025
1 parent 3003038 commit 87ce6a0
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions compat/win32/fscache.c
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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();

Expand Down

0 comments on commit 87ce6a0

Please sign in to comment.