{"thread":{"id":"48189","subject":"[PATCH] fast-import: fix a sparse 'NULL pointer' warning","startedAt":"2018-03-30T22:22:22Z","lastAt":"2018-03-30T22:26:16Z","messageCount":2,"participants":["Ramsay Jones","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"343493","messageId":"fdda3631-400c-1e6d-92b8-a68fc237a413@ramsayjones.plus.com","threadId":"48189","inReplyTo":null,"subject":"[PATCH] fast-import: fix a sparse 'NULL pointer' warning","fromName":"Ramsay Jones","fromEmail":"ramsay@ramsayjones.plus.com","sentAt":"2018-03-30T22:22:05Z","receivedAt":"2018-03-30T22:22:22Z","isPatch":true,"sender":{"key":"ramsay@ramsayjones.plus.com","avatar":"https://avatars.githubusercontent.com/u/33702710?v=4"},"body":"\nCommit a8dfa11562 (\"fast-import: introduce mem_pool type\", 2018-03-26)\nintroduces a 'mem_pool' type, along with a file-local global symbol\n('fi_mem_poll') which is initialised in its declaration. This causes\nsparse to issue a warning, thus:\n\n      SP fast-import.c\n  fast-import.c:301:40: warning: Using plain integer as NULL pointer\n\nIn order to suppress the warning, replace the '0' used to initialise the\n'mp_block' field (of type 'struct mp_block *') with NULL.\n\nSigned-off-by: Ramsay Jones <ramsay@ramsayjones.plus.com>\n---\n\nHi Junio,\n\nThis was going to be an email to Jameson, but I wasn't fast enough! :(\n\nThis was originally written against the 'pu' branch, but since the\n'jm/mem-pool' branch has graduated to 'next', I have rebased on 'next'.\n\nPerhaps this could be squashed into that branch when you re-build\nthe 'next' branch at the beginning of the next cycle?\n\nATB,\nRamsay Jones\n\n fast-import.c | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/fast-import.c b/fast-import.c\nindex 0aa148ea4..38356e293 100644\n--- a/fast-import.c\n+++ b/fast-import.c\n@@ -298,7 +298,7 @@ static int global_argc;\n static const char **global_argv;\n \n /* Memory pools */\n-static struct mem_pool fi_mem_pool =  {0, 2*1024*1024 - sizeof(struct mp_block), 0 };\n+static struct mem_pool fi_mem_pool =  {NULL, 2*1024*1024 - sizeof(struct mp_block), 0 };\n \n /* Atom management */\n static unsigned int atom_table_sz = 4451;\n-- \n2.16.0\n"},{"id":"343494","messageId":"xmqqin9d19q6.fsf@gitster-ct.c.googlers.com","threadId":"48189","inReplyTo":"fdda3631-400c-1e6d-92b8-a68fc237a413@ramsayjones.plus.com","subject":"Re: [PATCH] fast-import: fix a sparse 'NULL pointer' warning","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2018-03-30T22:26:09Z","receivedAt":"2018-03-30T22:26:16Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Ramsay Jones <ramsay@ramsayjones.plus.com> writes:\n\n> This was going to be an email to Jameson, but I wasn't fast enough! :(\n>\n> This was originally written against the 'pu' branch, but since the\n> 'jm/mem-pool' branch has graduated to 'next', I have rebased on 'next'.\n>\n> Perhaps this could be squashed into that branch when you re-build\n> the 'next' branch at the beginning of the next cycle?\n\nThanks.  \n\nYes, that would be the most sensible thing to do, I would think, as\nthe topic itself (like many other branches that are merged to 'next'\nduring the pre-release feature freeze period) is not ready for the\n'master' branch yet anyway.\n\n\n"}]}