DORMANTno replies

[PATCH] shut up gcc4's signed pointer warnings

From: Kay Sievers <hidden>
Date: 2016-06-15 22:41:56

Suppress these stupid warnings if gcc supports it:

  ls-tree.c: In function ‘list_recursive’:
  ls-tree.c:34: warning: pointer targets in passing argument 1 of ‘strlen’ differ in signedness
  ls-tree.c:34: warning: pointer targets in passing argument 1 of ‘__builtin_strcmp’ differ in signedness
  ls-tree.c:34: warning: pointer targets in passing argument 1 of ‘strlen’ differ in signedness
  ls-tree.c:34: warning: pointer targets in passing argument 1 of ‘__builtin_strcmp’ differ in signedness
  ls-tree.c:34: warning: pointer targets in passing argument 1 of ‘__builtin_strcmp’ differ in signedness
  ls-tree.c:34: warning: pointer targets in passing argument 1 of ‘__builtin_strcmp’ differ in signedness
  ls-tree.c:66: warning: pointer targets in passing argument 2 of ‘list_recursive’ differ in signedness

Signed-off-by: Kay Sievers <redacted>
---
--- a/Makefile
+++ b/Makefile
@@ -7,7 +7,11 @@
 # BREAK YOUR LOCAL DIFFS! show-diff and anything using it will likely randomly
 # break unless your underlying filesystem supports those sub-second times
 # (my ext3 doesn't).
+
+cc-supports = ${shell if $(CC) ${1} -S -o /dev/null -xc /dev/null > /dev/null 2>&1; then echo "$(1)"; fi;}
+
 CFLAGS=-g -O2 -Wall
+CFLAGS+= $(call cc-supports,-Wno-pointer-sign)
 
 CC=gcc
 AR=ar
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help