selftests: execveat: Fix _GNU_SOURCE redefined build warn
Subsystems (4)
Shuah Khan
maintainerPATCH v2 1/1 selftests: execveat: Fix _GNU_SOURCE redefined build warn
Fix the following _GNU_SOURCE redefined build warn:
execveat.c:8: warning: "_GNU_SOURCE" redefined
---
No code changes. Sending to right people.
tools/testing/selftests/exec/execveat.c | 2 ++ 1 file changed, 2 insertions(+)
tools/testing/selftests/exec/execveat.c +2 -0
@@ -5,7 +5,9 @@* Selftests for execveat(2). */ +#ifndef _GNU_SOURCE#define _GNU_SOURCE/* to get O_PATH, AT_EMPTY_PATH */ +#endif #include <sys/sendfile.h> #include <sys/stat.h> #include <sys/syscall.h>
Signature · 1 line
2.20.1
Shuah Khan
maintainerPATCH 1/1 selftests: proc: Fix _GNU_SOURCE redefined build warns
Fix the following _GNU_SOURCE redefined build warns:
proc-loadavg-001.c:17: warning: "_GNU_SOURCE" redefined proc-self-syscall.c:16: warning: "_GNU_SOURCE" redefined proc-uptime-002.c:18: warning: "_GNU_SOURCE" redefined
--- tools/testing/selftests/proc/proc-loadavg-001.c | 2 ++ tools/testing/selftests/proc/proc-self-syscall.c | 2 ++ tools/testing/selftests/proc/proc-uptime-002.c | 2 ++ 3 files changed, 6 insertions(+)
tools/testing/selftests/proc/proc-loadavg-001.c +2 -0
@@ -14,7 +14,9 @@* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ /* Test that /proc/loadavg correctly reports last pid in pid namespace. */ +#ifndef _GNU_SOURCE#define _GNU_SOURCE +#endif #include <errno.h> #include <sched.h> #include <sys/types.h>
tools/testing/selftests/proc/proc-self-syscall.c +2 -0
@@ -13,7 +13,9 @@* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ +#ifndef _GNU_SOURCE#define _GNU_SOURCE +#endif #include <unistd.h> #include <sys/syscall.h> #include <sys/types.h>
tools/testing/selftests/proc/proc-uptime-002.c +2 -0
@@ -15,7 +15,9 @@*/ // Test that values in /proc/uptime increment monotonically // while shifting across CPUs. +#ifndef _GNU_SOURCE#define _GNU_SOURCE +#endif #undef NDEBUG#include <assert.h> #include <unistd.h>
Signature · 1 line
2.20.1
Re: [PATCH] selftests: proc: Fix _GNU_SOURCE redefined build warns
tools/testing/selftests/proc/proc-loadavg-001.c line 19
Quoted 9 lines · Shuah Khan
Fix the following
_GNU_SOURCEredefined build warns:proc-loadavg-001.c:17: warning: "
_GNU_SOURCE" redefined proc-self-syscall.c:16: warning: "_GNU_SOURCE" redefined proc-uptime-002.c:18: warning: "_GNU_SOURCE" redefinedtools/testing/selftests/proc/proc-loadavg-001.c +2
-0+#ifndef _GNU_SOURCE#define _GNU_SOURCE +#endif
Why are you doing this.
There are 140 redefinitions of _GNU_SOURCE
Shuah Khan
maintainerRe: [PATCH] selftests: proc: Fix _GNU_SOURCE redefined build warns
Quoted 7 lines · Alexey Dobriyan
Quoted 5 lines · Shuah Khan
Fix the following
_GNU_SOURCEredefined build warns:proc-loadavg-001.c:17: warning: "
_GNU_SOURCE" redefined proc-self-syscall.c:16: warning: "_GNU_SOURCE" redefined proc-uptime-002.c:18: warning: "_GNU_SOURCE" redefined
Quoted 8 lines
tools/testing/selftests/proc/proc-loadavg-001.c line 19
Quoted 3 lines
tools/testing/selftests/proc/proc-loadavg-001.c +2
-0+#ifndef _GNU_SOURCE#define _GNU_SOURCE +#endif Why are you doing this.
There are 140 redefinitions of
_GNU_SOURCE
Is there something wrong with getting rid of this warning?
thanks,
-- Shuah