fibmap: include f2fs_fs.h before other header files
PATCH 1/1 fibmap: include f2fs_fs.h before other header files
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 <sys/sysmacros.h>. For historical compatibility, it is currently defined by <sys/types.h> as well, but we plan to remove this soon. To use "major", include <sys/sysmacros.h> directly. If you did not intend to use a system-defined macro "major", you should undefine it after including <sys/types.h>.
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 <[email protected]>
--- tools/fibmap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/fibmap.c +1 -1
@@ -15,6 +15,7 @@#ifndef O_LARGEFILE #define O_LARGEFILE 0#endif +#include <f2fs_fs.h> #include <unistd.h> #include <string.h> #include <stdlib.h>
@@ -38,7 +39,6 @@#include <linux/fs.h> #endif #include <inttypes.h> -#include <f2fs_fs.h> #ifndef FIBMAP #define FIBMAP _IO(0x00, 1)/* bmap access */
Signature · 10 lines
2.15.1 ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot _______________________________________________ Linux-f2fs-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel