git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] shut up gcc4's signed pointer warnings

From
KSKay Sievers <kay.sievers@vrfy.org>
Date
May 5, 2005, 01:30 UTC
Message-ID
<20050505013037.GA26290@vrfy.org>
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>
---
--- 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
Message 1 of 1 in “shut up gcc4's signed pointer warnings”
  1. shut up gcc4's signed pointer warningsKay Sievers, May 5, 2005

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.