linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] selftests: proc: Fix _GNU_SOURCE redefined build warns
       [not found] <20190924181910.23588-1-skhan@linuxfoundation.org>
@ 2019-09-24 18:19 ` Shuah Khan
  2019-09-24 19:52   ` Alexey Dobriyan
  0 siblings, 1 reply; 3+ messages in thread
From: Shuah Khan @ 2019-09-24 18:19 UTC (permalink / raw)
  To: adobriyan, shuah, akpm, sabyasachi.linux, jrdr.linux
  Cc: Shuah Khan, linux-kernel, linux-fsdevel, linux-kselftest

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>
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] selftests: proc: Fix _GNU_SOURCE redefined build warns
  2019-09-24 18:19 ` [PATCH] selftests: proc: Fix _GNU_SOURCE redefined build warns Shuah Khan
@ 2019-09-24 19:52   ` Alexey Dobriyan
  2019-09-24 20:05     ` Shuah Khan
  0 siblings, 1 reply; 3+ messages in thread
From: Alexey Dobriyan @ 2019-09-24 19:52 UTC (permalink / raw)
  To: Shuah Khan
  Cc: shuah, akpm, sabyasachi.linux, jrdr.linux, linux-kernel,
	linux-fsdevel, linux-kselftest

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] selftests: proc: Fix _GNU_SOURCE redefined build warns
  2019-09-24 19:52   ` Alexey Dobriyan
@ 2019-09-24 20:05     ` Shuah Khan
  0 siblings, 0 replies; 3+ messages in thread
From: Shuah Khan @ 2019-09-24 20:05 UTC (permalink / raw)
  To: Alexey Dobriyan
  Cc: shuah, akpm, sabyasachi.linux, jrdr.linux, linux-kernel,
	linux-fsdevel, linux-kselftest, skh >> Shuah Khan

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-09-24 20:05 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20190924181910.23588-1-skhan@linuxfoundation.org>
2019-09-24 18:19 ` [PATCH] selftests: proc: Fix _GNU_SOURCE redefined build warns Shuah Khan
2019-09-24 19:52   ` Alexey Dobriyan
2019-09-24 20:05     ` Shuah Khan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).