{"thread":{"id":"27022","subject":"[PATCH 1/9] Makefile: Use cgcc rather than sparse in the check target","startedAt":"2011-04-07T18:22:18Z","lastAt":"2011-04-07T18:22:18Z","messageCount":1,"participants":["Ramsay Jones"],"isPatch":true,"patchVersion":1,"patchTotal":9},"messages":[{"id":"165370","messageId":"4D9E00DA.4060807@ramsay1.demon.co.uk","threadId":"27022","inReplyTo":null,"subject":"[PATCH 1/9] Makefile: Use cgcc rather than sparse in the check target","fromName":"Ramsay Jones","fromEmail":"ramsay@ramsay1.demon.co.uk","sentAt":"2011-04-07T18:22:18Z","receivedAt":"2011-04-07T18:22:18Z","isPatch":true,"sender":{"key":"ramsay@ramsayjones.plus.com","avatar":"https://avatars.githubusercontent.com/u/33702710?v=4"},"body":"\ncgcc is the recommended way to run sparse, since it provides\nmany -Defines suitable for the given gcc platform. Using an\n\"cgcc -no-compile\" command runs sparse, with all the platform\nspecific definitions provided by cgcc, without also invoking\ngcc.\n\nSigned-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>\n---\n\nNote that the \"-isystem /usr/include/w32api\" should be provided by\ncgcc, but when adding cygwin support none of my projects (including\ngit) included any windows code, so I didn't notice.\n\n Makefile |   11 ++++++-----\n 1 files changed, 6 insertions(+), 5 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex 92c1c5e..79bef43 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -323,9 +323,7 @@ GCOV = gcov\n \n export TCL_PATH TCLTK_PATH\n \n-# sparse is architecture-neutral, which means that we need to tell it\n-# explicitly what architecture to check for. Fix this up for yours..\n-SPARSE_FLAGS = -D__BIG_ENDIAN__ -D__powerpc__\n+SPARSE_FLAGS =\n \n \n \n@@ -924,6 +922,7 @@ ifeq ($(uname_O),Cygwin)\n \tX = .exe\n \tCOMPAT_OBJS += compat/cygwin.o\n \tUNRELIABLE_FSTAT = UnfortunatelyYes\n+\tSPARSE_FLAGS = -isystem /usr/include/w32api -Wno-one-bit-signed-bitfield\n endif\n ifeq ($(uname_S),FreeBSD)\n \tNEEDS_LIBICONV = YesPlease\n@@ -1177,6 +1176,7 @@ ifneq (,$(findstring MINGW,$(uname_S)))\n \tEXTLIBS += -lws2_32\n \tPTHREAD_LIBS =\n \tX = .exe\n+\tSPARSE_FLAGS = -Wno-one-bit-signed-bitfield\n ifneq (,$(wildcard ../THIS_IS_MSYSGIT))\n \thtmldir=doc/git/html/\n \tprefix =\n@@ -2160,11 +2160,12 @@ check-sha1:: test-sha1$X\n \t./test-sha1.sh\n \n check: common-cmds.h\n-\tif sparse; \\\n+\t@if sparse; \\\n \tthen \\\n \t\tfor i in $(patsubst %.o, %.c, $(GIT_OBJS)); \\\n \t\tdo \\\n-\t\t\tsparse $(ALL_CFLAGS) $(SPARSE_FLAGS) $$i || exit; \\\n+\t\t\techo '   ' SP $$i; \\\n+\t\t\tcgcc -no-compile $(ALL_CFLAGS) $(SPARSE_FLAGS) $$i || exit; \\\n \t\tdone; \\\n \telse \\\n \t\techo 2>&1 \"Did you mean 'make test'?\"; \\\n-- \n1.7.4\n"}]}