Whamcloud - gitweb
Fix compile error and warnings for old gcc versions
authorLi Dongyang <dongyangli@ddn.com>
Sat, 14 Jul 2018 00:42:48 +0000 (18:42 -0600)
committerTheodore Ts'o <tytso@mit.edu>
Sun, 15 Jul 2018 00:46:30 +0000 (20:46 -0400)
commitfddc423dc6353552772969d70cec08e8378d8e57
tree8086b02c564916b3c7c6174d093284d4bbbd9ef1
parente96393142ccd1da25ac1e2c9cebd7f20326f36c5
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>
debugfs/set_fields.c
e2fsck/problem.c
lib/ext2fs/ext4_acl.h
lib/ext2fs/fiemap.h
lib/ext2fs/hashmap.h
lib/ext2fs/mmp.c
lib/ext2fs/unix_io.c
lib/uuid/gen_uuid.c
misc/e2undo.c
misc/filefrag.c
misc/fuse2fs.c