Fix the following _GNU_SOURCE redefined build warn:
execveat.c:8: warning: "_GNU_SOURCE" redefined
Signed-off-by: Shuah Khan skhan@linuxfoundation.org --- No code changes. Sending to right people.
tools/testing/selftests/exec/execveat.c | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/tools/testing/selftests/exec/execveat.c b/tools/testing/selftests/exec/execveat.c index cbb6efbdb786..045a3794792a 100644 --- a/tools/testing/selftests/exec/execveat.c +++ b/tools/testing/selftests/exec/execveat.c @@ -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>
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
Signed-off-by: Shuah Khan skhan@linuxfoundation.org --- 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(+)
diff --git a/tools/testing/selftests/proc/proc-loadavg-001.c b/tools/testing/selftests/proc/proc-loadavg-001.c index 471e2aa28077..e29326a708e4 100644 --- a/tools/testing/selftests/proc/proc-loadavg-001.c +++ b/tools/testing/selftests/proc/proc-loadavg-001.c @@ -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> diff --git a/tools/testing/selftests/proc/proc-self-syscall.c b/tools/testing/selftests/proc/proc-self-syscall.c index 9f6d000c0245..6a01448df035 100644 --- a/tools/testing/selftests/proc/proc-self-syscall.c +++ b/tools/testing/selftests/proc/proc-self-syscall.c @@ -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> diff --git a/tools/testing/selftests/proc/proc-uptime-002.c b/tools/testing/selftests/proc/proc-uptime-002.c index 30e2b7849089..35eec74540ae 100644 --- a/tools/testing/selftests/proc/proc-uptime-002.c +++ b/tools/testing/selftests/proc/proc-uptime-002.c @@ -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>
On Tue, Sep 24, 2019 at 12:19:10PM -0600, Shuah Khan wrote:
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
+#ifndef _GNU_SOURCE #define _GNU_SOURCE +#endif
Why are you doing this.
There are 140 redefinitions of _GNU_SOURCE
On 9/24/19 1:52 PM, Alexey Dobriyan wrote:
On Tue, Sep 24, 2019 at 12:19:10PM -0600, Shuah Khan wrote:
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
+#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
linux-kselftest-mirror@lists.linaro.org