From 4d4a9f2d4594f43b486cda79fff9f7d19e4a4d36 Mon Sep 17 00:00:00 2001 From: Sheng Yong Date: Tue, 27 Feb 2018 16:39:33 +0800 Subject: [PATCH] fibmap: include f2fs_fs.h before other header files MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit GCC 7.2.0 is unhappy with the usage of major/minor: fibmap.c: In function ‘print_stat’: fibmap.c:70:13: warning: In the GNU C Library, "major" is defined by . For historical compatibility, it is currently defined by as well, but we plan to remove this soon. To use "major", include directly. If you did not intend to use a system-defined macro "major", you should undefine it after including . printf("dev [%d:%d]\n", major(st->st_dev), minor(st->st_dev)); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ This is because config.h is not included first, as a result, macros defined in config.h is not recognized. So let's include f2fs_fs.h before other header files. Signed-off-by: Sheng Yong Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim --- tools/fibmap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/fibmap.c b/tools/fibmap.c index d17144a..9e96cb6 100644 --- a/tools/fibmap.c +++ b/tools/fibmap.c @@ -15,6 +15,7 @@ #ifndef O_LARGEFILE #define O_LARGEFILE 0 #endif +#include #include #include #include @@ -38,7 +39,6 @@ #include #endif #include -#include #ifndef FIBMAP #define FIBMAP _IO(0x00, 1) /* bmap access */ -- 2.7.4