]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Squash glibc warning about _BSD_SOURCE being deprecated tests.
authorMark Wielaard <mark@klomp.org>
Fri, 22 Jan 2016 13:49:22 +0000 (13:49 +0000)
committerMark Wielaard <mark@klomp.org>
Fri, 22 Jan 2016 13:49:22 +0000 (13:49 +0000)
glibc 2.20 deprecated _BSD_SOURCE and _SVID_SOURCE and now requires
_DEFAULT_SOURCE to be defined instead. Add _DEFAULT_SOURCE define to
prevent warnings like:

In file included from /usr/include/stdio.h:27:0,
                 from stack_switch.c:5:
/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"
   ^

See https://sourceware.org/glibc/wiki/Release/2.20#Packaging_Changes

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15768

memcheck/tests/linux/stack_switch.c

index 1011f75f8ebc4a4e695533ad7f47d83cbaa93c66..5c1984036c1583a759c8d7e254d361b100257e2d 100644 (file)
@@ -1,5 +1,11 @@
 #define _XOPEN_SOURCE 600
+
+/* Legacy feature macro.  */
 #define _BSD_SOURCE
+/* New feature macro, always define to squash warning about _BSD_SOURCE
+   with glibc 2.20+.  */
+#define _DEFAULT_SOURCE 1
+
 #define _GNU_SOURCE
 
 #include <stdio.h>