Skip to content

Commit 8e4b4ce

Browse files
committed
squash! mingw: make the dirent implementation plugable
40e4213 (mingw: make the dirent implementation pluggable, 2013-09-08) introduces a FLEX_ARRAY fot this structure, which is not allowed per ISO C 11 6.7.2.1¶3. Punt the error, as it is suspected that both supported compilers do the right thing. Signed-off-by: Carlo Marcelo Arenas Belón <[email protected]>
1 parent 629aaaa commit 8e4b4ce

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

compat/win32/dirent.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
#include "../../git-compat-util.h"
22

3+
#pragma GCC diagnostic push
4+
#pragma GCC diagnostic ignored "-Wpedantic"
35
typedef struct dirent_DIR {
46
struct DIR base_dir; /* extend base struct DIR */
57
HANDLE dd_handle; /* FindFirstFile handle */
68
int dd_stat; /* 0-based index */
79
struct dirent dd_dir; /* includes d_type */
810
} dirent_DIR;
11+
#pragma GCC diagnostic pop
912

1013
DIR *(*opendir)(const char *dirname) = dirent_opendir;
1114

compat/win32/fscache.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ static struct trace_key trace_fscache = TRACE_KEY_INIT(FSCACHE);
3838
* An entry in the file system cache. Used for both entire directory listings
3939
* and file entries.
4040
*/
41+
#pragma GCC diagnostic push
42+
#pragma GCC diagnostic ignored "-Wpedantic"
4143
struct fsentry {
4244
struct hashmap_entry ent;
4345
mode_t st_mode;
@@ -70,6 +72,7 @@ struct fsentry {
7072
*/
7173
struct dirent dirent;
7274
};
75+
#pragma GCC diagnostic pop
7376

7477
struct heap_fsentry {
7578
struct fsentry ent;

0 commit comments

Comments
 (0)