threads / patch / 483

patchshut up gcc4's signed pointer warnings

Subject: [PATCH] shut up gcc4's signed pointer warnings

## tl;dr

One message between May 5, 2005 and May 5, 2005. Diffs are folded; open one to read it.

replies: 0people: 1as markdown or json

Kay Sievers· May 5, 2005, 01:30 UTC · lore
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 <kay.sievers@vrfy.org>
---
Show changes to Makefile +4 −0
--- 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

← back to recent threads