diff options
author | Ross Zwisler <ross.zwisler@linux.intel.com> | 2017-12-07 14:35:01 -0700 |
---|---|---|
committer | Eryu Guan <eguan@redhat.com> | 2017-12-10 17:46:05 +0800 |
commit | 8b71ca416246277481aee2dd74684797dd01101f (patch) | |
tree | f0e414fcec7db2ade245f9b33a743d42ccc03cd3 | |
parent | 729b2bc7641c4ad30af071baaa2714d76babd246 (diff) | |
download | xfstests-8b71ca416246277481aee2dd74684797dd01101f.tar.gz |
build: fix _BSD_SOURCE complier warning
When compiling xfstests with either gcc 6.4.1 or 7.2.1 I see the
following warning:
In file included from /usr/include/stdio.h:27:0,
from fssum.c:25:
/usr/include/features.h:148:3: warning: #warning "_BSD_SOURCE and _SVID_SOURCE
are deprecated, use _DEFAULT_SOURCE" [-Wcpp]
# warning "_BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE"
^~~~~~~
The feature_test_macros(7) man page says this about _BSD_SOURCE:
Since glibc 2.20, this macro is deprecated. It now has the same
effect as defining _DEFAULT_SOURCE, but generates a compile-time
warning (unless _DEFAULT_SOURCE is also defined). Use
_DEFAULT_SOURCE instead. To allow code that requires _BSD_SOURCE
in glibc 2.19 and earlier and _DEFAULT_SOURCE in glibc 2.20 and
later to compile without warnings, define both _BSD_SOURCE and
_DEFAULT_SOURCE.
Keep backwards compatibility with older code by defining both
_BSD_SOURCE and _DEFAULT_SOURCE.
Signed-off-by: Ross Zwisler <ross.zwisler@linux.intel.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
-rw-r--r-- | src/fssum.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/fssum.c b/src/fssum.c index 04052cdc82..13111d6fef 100644 --- a/src/fssum.c +++ b/src/fssum.c @@ -17,6 +17,7 @@ */ #ifdef __linux__ #define _BSD_SOURCE +#define _DEFAULT_SOURCE #define _LARGEFILE64_SOURCE #ifndef _GNU_SOURCE #define _GNU_SOURCE |