{"thread":{"id":"47814","subject":"[PATCH 2/2] Makefile: suppress a sparse warning for pack-revindex.c","startedAt":"2018-02-12T00:21:07Z","lastAt":"2018-02-12T00:21:07Z","messageCount":1,"participants":["Ramsay Jones"],"isPatch":true,"patchVersion":1,"patchTotal":2},"messages":[{"id":"339029","messageId":"a57fbfc1-a5a5-0e86-2bbf-82c33909458e@ramsayjones.plus.com","threadId":"47814","inReplyTo":null,"subject":"[PATCH 2/2] Makefile: suppress a sparse warning for pack-revindex.c","fromName":"Ramsay Jones","fromEmail":"ramsay@ramsayjones.plus.com","sentAt":"2018-02-12T00:21:02Z","receivedAt":"2018-02-12T00:21:07Z","isPatch":true,"sender":{"key":"ramsay@ramsayjones.plus.com","avatar":"https://avatars.githubusercontent.com/u/33702710?v=4"},"body":"\nSparse has, for a long time, been issuing the following warning against\nthe pack-revindex.c file:\n\n      SP pack-revindex.c\n  pack-revindex.c:64:23: warning: memset with byte count of 262144\n\nThis results from a unconditional check, with a hard-coded limit, which\nis really only appropriate for the kernel source code. (The check is for\na 'large' byte count in a call to memcpy(), memset(), copy_from_user()\nand copy_to_user() functions).\n\nA recent release of sparse (v0.5.1) has introduced some options to allow\nthis check to be turned off (-Wno-memcpy-max-count) or to specify the\nactual limit used (-fmemcpy-max-count=COUNT), rather than a hard-coded\nlimit of 100000.\n\nIn order to suppress the warning, add a target for pack-revindex.sp that\nadds the '-Wno-memcpy-max-count' option to the SPARSE_FLAGS variable.\n\nSigned-off-by: Ramsay Jones <ramsay@ramsayjones.plus.com>\n---\n Makefile | 2 ++\n 1 file changed, 2 insertions(+)\n\ndiff --git a/Makefile b/Makefile\nindex 1a9b23b67..7f40f7673 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -2176,6 +2176,8 @@ gettext.sp gettext.s gettext.o: EXTRA_CPPFLAGS = \\\n http-push.sp http.sp http-walker.sp remote-curl.sp imap-send.sp: SPARSE_FLAGS += \\\n \t-DCURL_DISABLE_TYPECHECK\n \n+pack-revindex.sp: SPARSE_FLAGS += -Wno-memcpy-max-count\n+\n ifdef NO_EXPAT\n http-walker.sp http-walker.s http-walker.o: EXTRA_CPPFLAGS = -DNO_EXPAT\n endif\n-- \n2.16.0\n"}]}