linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] selftests: mqueue|vDSO: fix convert pointer warnings
@ 2021-11-05 16:29 Anders Roxell
  2021-11-19 23:52 ` Shuah Khan
  0 siblings, 1 reply; 2+ messages in thread
From: Anders Roxell @ 2021-11-05 16:29 UTC (permalink / raw)
  To: shuah; +Cc: linux-kselftest, linux-kernel, Anders Roxell

When building selftests, mqueue and vDSO the following shows up:

warning: passing 'int *' to parameter of type 'unsigned int *' converts between pointers to integer types with different sign [-Wpointer-sign]

warning: passing 'const char *' to parameter of type 'const unsigned char *' converts between pointers to integer types where one is of the unique plain 'char' type and the other is not [-Wpointer-sign]

The code looked OK so what normally are done are, adding the compiler
directive to hide the warnings '-Wno-pointer-sign'.

Signed-off-by: Anders Roxell <anders.roxell@linaro.org>
---
 tools/testing/selftests/mqueue/Makefile | 2 +-
 tools/testing/selftests/vDSO/Makefile   | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/testing/selftests/mqueue/Makefile b/tools/testing/selftests/mqueue/Makefile
index 8a58055fc1f5..814907b6344f 100644
--- a/tools/testing/selftests/mqueue/Makefile
+++ b/tools/testing/selftests/mqueue/Makefile
@@ -1,5 +1,5 @@
 # SPDX-License-Identifier: GPL-2.0
-CFLAGS += -O2
+CFLAGS += -O2 -Wno-pointer-sign
 LDLIBS = -lrt -lpthread -lpopt
 
 TEST_GEN_PROGS := mq_open_tests mq_perf_tests
diff --git a/tools/testing/selftests/vDSO/Makefile b/tools/testing/selftests/vDSO/Makefile
index d53a4d8008f9..2a60233ba2fb 100644
--- a/tools/testing/selftests/vDSO/Makefile
+++ b/tools/testing/selftests/vDSO/Makefile
@@ -12,7 +12,7 @@ TEST_GEN_PROGS += $(OUTPUT)/vdso_standalone_test_x86
 endif
 TEST_GEN_PROGS += $(OUTPUT)/vdso_test_correctness
 
-CFLAGS := -std=gnu99
+CFLAGS := -std=gnu99 -Wno-pointer-sign
 CFLAGS_vdso_standalone_test_x86 := -nostdlib -fno-asynchronous-unwind-tables -fno-stack-protector
 LDFLAGS_vdso_test_correctness := -ldl
 ifeq ($(CONFIG_X86_32),y)
-- 
2.33.0


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

* Re: [PATCH] selftests: mqueue|vDSO: fix convert pointer warnings
  2021-11-05 16:29 [PATCH] selftests: mqueue|vDSO: fix convert pointer warnings Anders Roxell
@ 2021-11-19 23:52 ` Shuah Khan
  0 siblings, 0 replies; 2+ messages in thread
From: Shuah Khan @ 2021-11-19 23:52 UTC (permalink / raw)
  To: Anders Roxell, shuah; +Cc: linux-kselftest, linux-kernel, Shuah Khan

On 11/5/21 10:29 AM, Anders Roxell wrote:
> When building selftests, mqueue and vDSO the following shows up:
> 
> warning: passing 'int *' to parameter of type 'unsigned int *' converts between pointers to integer types with different sign [-Wpointer-sign]
> 
> warning: passing 'const char *' to parameter of type 'const unsigned char *' converts between pointers to integer types where one is of the unique plain 'char' type and the other is not [-Wpointer-sign]
> 
> The code looked OK so what normally are done are, adding the compiler
> directive to hide the warnings '-Wno-pointer-sign'.
> 

Would be nice to see the lines of code that are generating these warns.

I don't want to see the warnings suppressed all together in the Makefile.
I don't see any point in doing so and it will suppress real problems in
the future.

I won't be accepting this patch.

thanks,
-- Shuah

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

end of thread, other threads:[~2021-11-19 23:52 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-05 16:29 [PATCH] selftests: mqueue|vDSO: fix convert pointer warnings Anders Roxell
2021-11-19 23:52 ` 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).