aboutsummaryrefslogtreecommitdiff
path: root/misc/fuse2fs.c
diff options
context:
space:
mode:
authorLi Dongyang <dongyangli@ddn.com>2018-07-13 18:42:48 -0600
committerTheodore Ts'o <tytso@mit.edu>2018-07-14 20:46:30 -0400
commitfddc423dc6353552772969d70cec08e8378d8e57 (patch)
tree8086b02c564916b3c7c6174d093284d4bbbd9ef1 /misc/fuse2fs.c
parente96393142ccd1da25ac1e2c9cebd7f20326f36c5 (diff)
downloade2fsprogs-fddc423dc6353552772969d70cec08e8378d8e57.tar.gz
Fix compile error and warnings for old gcc versions
-Wimplicit-fallthrough option was added in gcc7 and -Wpedantic was added in gcc4.8, while #pragma GCC diagnostic support was not available until gcc4.6 We got following warnings: ../lib/ext2fs/fiemap.h:35: warning: expected [error|warning|ignored] after ‘#pragma GCC diagnostic’ ../lib/ext2fs/fiemap.h:36: warning: unknown option after ‘#pragma GCC diagnostic’ kind ../lib/ext2fs/fiemap.h:38: warning: expected [error|warning|ignored] after ‘#pragma GCC diagnostic’ and error: filefrag.c: In function ‘main’: filefrag.c:577: error: #pragma GCC diagnostic not allowed inside functions filefrag.c:578: error: #pragma GCC diagnostic not allowed inside functions filefrag.c:595: error: #pragma GCC diagnostic not allowed inside functions when compiling latest e2fsprogs with a gcc older than 4.6 e.g. on CentOS 6.9 Signed-off-by: Li Dongyang <dongyangli@ddn.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Diffstat (limited to 'misc/fuse2fs.c')
-rw-r--r--misc/fuse2fs.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/misc/fuse2fs.c b/misc/fuse2fs.c
index 056d34ec..5c73895e 100644
--- a/misc/fuse2fs.c
+++ b/misc/fuse2fs.c
@@ -118,10 +118,14 @@ typedef struct {
typedef struct {
u_int32_t a_version;
+#if __GNUC_PREREQ (4, 8)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wpedantic"
+#endif
acl_ea_entry a_entries[0];
+#if __GNUC_PREREQ (4, 8)
#pragma GCC diagnostic pop
+#endif
} acl_ea_header;
static inline size_t acl_ea_size(int count)