Skip to content

Commit f228d1f

Browse files
Ramsay Jonesgitster
authored andcommitted
Makefile: Use cgcc rather than sparse in the check target
cgcc is the recommended way to run sparse, since it provides many -Defines suitable for the given gcc platform. Using an "cgcc -no-compile" command runs sparse, with all the platform specific definitions provided by cgcc, without also invoking gcc. Signed-off-by: Ramsay Jones <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent ff46a49 commit f228d1f

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

Makefile

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -323,9 +323,7 @@ GCOV = gcov
323323

324324
export TCL_PATH TCLTK_PATH
325325

326-
# sparse is architecture-neutral, which means that we need to tell it
327-
# explicitly what architecture to check for. Fix this up for yours..
328-
SPARSE_FLAGS = -D__BIG_ENDIAN__ -D__powerpc__
326+
SPARSE_FLAGS =
329327

330328

331329

@@ -924,6 +922,7 @@ ifeq ($(uname_O),Cygwin)
924922
X = .exe
925923
COMPAT_OBJS += compat/cygwin.o
926924
UNRELIABLE_FSTAT = UnfortunatelyYes
925+
SPARSE_FLAGS = -isystem /usr/include/w32api -Wno-one-bit-signed-bitfield
927926
endif
928927
ifeq ($(uname_S),FreeBSD)
929928
NEEDS_LIBICONV = YesPlease
@@ -1177,6 +1176,7 @@ ifneq (,$(findstring MINGW,$(uname_S)))
11771176
EXTLIBS += -lws2_32
11781177
PTHREAD_LIBS =
11791178
X = .exe
1179+
SPARSE_FLAGS = -Wno-one-bit-signed-bitfield
11801180
ifneq (,$(wildcard ../THIS_IS_MSYSGIT))
11811181
htmldir=doc/git/html/
11821182
prefix =
@@ -2161,11 +2161,12 @@ check-sha1:: test-sha1$X
21612161
./test-sha1.sh
21622162

21632163
check: common-cmds.h
2164-
if sparse; \
2164+
@if sparse; \
21652165
then \
21662166
for i in $(patsubst %.o, %.c, $(GIT_OBJS)); \
21672167
do \
2168-
sparse $(ALL_CFLAGS) $(SPARSE_FLAGS) $$i || exit; \
2168+
echo ' ' SP $$i; \
2169+
cgcc -no-compile $(ALL_CFLAGS) $(SPARSE_FLAGS) $$i || exit; \
21692170
done; \
21702171
else \
21712172
echo 2>&1 "Did you mean 'make test'?"; \

0 commit comments

Comments
 (0)