btrfs-progs: Specify C standard to gnu90 explicitly
authorQu Wenruo <quwenruo.btrfs@gmx.com>
Tue, 15 Aug 2017 00:17:12 +0000 (09:17 +0900)
committerDavid Sterba <dsterba@suse.com>
Thu, 24 Aug 2017 17:06:33 +0000 (19:06 +0200)
Different C compilers have different default language standard.
This sometimes causes problem on different system.

For distribution like CentOS/RHEL7, its gcc is still 4.8 and will report
error for c90 style declaration, while most developers are using newer
gcc which will just ignore it.
This makes us hard to detect such language standard problem.

This patch will specify standard to gnu90 explicitly to avoid such problem.
Gnu90 is a good mix of c90 while provide a lot of useful gnu extension,
and is supported by all modern gcc and clang.

Reported-by: Marco Lorenzo Crociani <marcoc@prismatelecomtesting.com>
Signed-off-by: Qu Wenruo <quwenruo.btrfs@gmx.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Makefile

index 0cee85f..7d35245 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -59,6 +59,7 @@ TOPDIR := $(shell pwd)
 
 # Common build flags
 CFLAGS = $(SUBST_CFLAGS) \
+        -std=gnu90 \
         -include config.h \
         -DBTRFS_FLAT_INCLUDES \
         -D_XOPEN_SOURCE=700  \