Commit 80133dad8aa9b6d8bec7050a77d603c53ecd8512

Ramsay Jones 2008-11-29T19:19:31

Use cgcc in the sparse target cgcc is the recommended way to run sparse, since it provides many -Defines suitable to the given gcc platform. For example, on some Ubuntu/glibc versions, a plain sparse invocation gives the following warning: "warning: This machine appears to be neither x86_64 nor i386." Using "cgcc -no-compile" instead eliminates this warning. Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk> Acked-by: Andreas Ericsson <ae@op5.se> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>

1
2
3
4
5
6
7
8
9
10
11
12
13
diff --git a/Makefile b/Makefile
index 4ea481c..01ef4fa 100644
--- a/Makefile
+++ b/Makefile
@@ -38,7 +38,7 @@ apidocs:
 test: $(TEST_RUN)
 
 sparse:
-	sparse -DSPARSE_IS_RUNNING $(ALL_CFLAGS) $(SPARSE_FLAGS) $(SRC_C)
+	cgcc -no-compile -DSPARSE_IS_RUNNING $(ALL_CFLAGS) $(SPARSE_FLAGS) $(SRC_C)
 
 install-headers: $(PUBLIC_HEADERS)
 	@mkdir -p /tmp/gitinc/git