{"thread":{"id":"30526","subject":"[PATCH] builtin/blame.c: Fix a \"Using plain integer as NULL pointer\" warning","startedAt":"2012-05-13T21:41:16Z","lastAt":"2012-05-15T17:33:12Z","messageCount":3,"participants":["Ramsay Jones","René Scharfe"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"191475","messageId":"4FB02A7C.1000605@ramsay1.demon.co.uk","threadId":"30526","inReplyTo":null,"subject":"[PATCH] builtin/blame.c: Fix a \"Using plain integer as NULL pointer\" warning","fromName":"Ramsay Jones","fromEmail":"ramsay@ramsay1.demon.co.uk","sentAt":"2012-05-13T21:41:16Z","receivedAt":"2012-05-13T21:41:16Z","isPatch":true,"sender":{"key":"ramsay@ramsayjones.plus.com","avatar":"https://avatars.githubusercontent.com/u/33702710?v=4"},"body":"\n\nSigned-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>\n---\n\nHi Junio,\n\nI try to catch these warnings, while the topics are still in the\npu branch, so that we can squash the fix into them before they\nhit next. I don't know how I missed this one (commit 4b4132f,\n\"blame: factor out helper for calling xdi_diff()\", 09-05-2012)\nwhich was part of the 'rs/xdiff-lose-emit-func' branch.\n\nSorry about that.\n\nATB,\nRamsay Jones\n\n\n builtin/blame.c |    2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/builtin/blame.c b/builtin/blame.c\nindex 778d661..24d3dd5 100644\n--- a/builtin/blame.c\n+++ b/builtin/blame.c\n@@ -93,7 +93,7 @@ static int diff_hunks(mmfile_t *file_a, mmfile_t *file_b, long ctxlen,\n {\n \txpparam_t xpp = {0};\n \txdemitconf_t xecfg = {0};\n-\txdemitcb_t ecb = {0};\n+\txdemitcb_t ecb = {NULL};\n \n \txpp.flags = xdl_opts;\n \txecfg.ctxlen = ctxlen;\n-- \n1.7.10\n"},{"id":"191478","messageId":"4FB0463D.4010909@lsrfire.ath.cx","threadId":"30526","inReplyTo":"4FB02A7C.1000605@ramsay1.demon.co.uk","subject":"Re: [PATCH] builtin/blame.c: Fix a \"Using plain integer as NULL pointer\" warning","fromName":"René Scharfe","fromEmail":"rene.scharfe@lsrfire.ath.cx","sentAt":"2012-05-13T23:39:41Z","receivedAt":"2012-05-13T23:39:41Z","isPatch":true,"sender":{"key":"l.s.r@web.de","avatar":"https://avatars.githubusercontent.com/u/26122331?v=4"},"body":"Am 13.05.2012 23:41, schrieb Ramsay Jones:\n>\n>\n> Signed-off-by: Ramsay Jones<ramsay@ramsay1.demon.co.uk>\n> ---\n>\n> Hi Junio,\n>\n> I try to catch these warnings, while the topics are still in the\n> pu branch, so that we can squash the fix into them before they\n> hit next. I don't know how I missed this one (commit 4b4132f,\n> \"blame: factor out helper for calling xdi_diff()\", 09-05-2012)\n> which was part of the 'rs/xdiff-lose-emit-func' branch.\n>\n> Sorry about that.\n>\n> ATB,\n> Ramsay Jones\n>\n>\n>   builtin/blame.c |    2 +-\n>   1 file changed, 1 insertion(+), 1 deletion(-)\n>\n> diff --git a/builtin/blame.c b/builtin/blame.c\n> index 778d661..24d3dd5 100644\n> --- a/builtin/blame.c\n> +++ b/builtin/blame.c\n> @@ -93,7 +93,7 @@ static int diff_hunks(mmfile_t *file_a, mmfile_t *file_b, long ctxlen,\n>   {\n>   \txpparam_t xpp = {0};\n>   \txdemitconf_t xecfg = {0};\n> -\txdemitcb_t ecb = {0};\n> +\txdemitcb_t ecb = {NULL};\n>\n>   \txpp.flags = xdl_opts;\n>   \txecfg.ctxlen = ctxlen;\n\nThe warning is given by sparse, not a C compiler, correct?  It's \nprobably worth shutting it up by making that change; my excuse for using \n{0} is that it is such a nice and portable idiom [1] for initializing \nany structure, however.\n\nRené\n\n\n[1] http://www.ex-parrot.com/~chris/random/initialise.html\n"},{"id":"191560","messageId":"4FB29358.90408@ramsay1.demon.co.uk","threadId":"30526","inReplyTo":"4FB0463D.4010909@lsrfire.ath.cx","subject":"Re: [PATCH] builtin/blame.c: Fix a \"Using plain integer as NULL pointer\" warning","fromName":"Ramsay Jones","fromEmail":"ramsay@ramsay1.demon.co.uk","sentAt":"2012-05-15T17:33:12Z","receivedAt":"2012-05-15T17:33:12Z","isPatch":true,"sender":{"key":"ramsay@ramsayjones.plus.com","avatar":"https://avatars.githubusercontent.com/u/33702710?v=4"},"body":"René Scharfe wrote:\n> Am 13.05.2012 23:41, schrieb Ramsay Jones:\n>>\n>> Signed-off-by: Ramsay Jones<ramsay@ramsay1.demon.co.uk>\n>> ---\n>>\n>> Hi Junio,\n>>\n>> I try to catch these warnings, while the topics are still in the\n>> pu branch, so that we can squash the fix into them before they\n>> hit next. I don't know how I missed this one (commit 4b4132f,\n>> \"blame: factor out helper for calling xdi_diff()\", 09-05-2012)\n>> which was part of the 'rs/xdiff-lose-emit-func' branch.\n>>\n>> Sorry about that.\n>>\n>> ATB,\n>> Ramsay Jones\n>>\n>>\n>>   builtin/blame.c |    2 +-\n>>   1 file changed, 1 insertion(+), 1 deletion(-)\n>>\n>> diff --git a/builtin/blame.c b/builtin/blame.c\n>> index 778d661..24d3dd5 100644\n>> --- a/builtin/blame.c\n>> +++ b/builtin/blame.c\n>> @@ -93,7 +93,7 @@ static int diff_hunks(mmfile_t *file_a, mmfile_t *file_b, long ctxlen,\n>>   {\n>>   \txpparam_t xpp = {0};\n>>   \txdemitconf_t xecfg = {0};\n>> -\txdemitcb_t ecb = {0};\n>> +\txdemitcb_t ecb = {NULL};\n>>\n>>   \txpp.flags = xdl_opts;\n>>   \txecfg.ctxlen = ctxlen;\n> \n> The warning is given by sparse, not a C compiler, correct?  It's \n> probably worth shutting it up by making that change; my excuse for using \n> {0} is that it is such a nice and portable idiom [1] for initializing \n> any structure, however.\n\nYes, sorry, it is indeed a sparse warning. (The original\nsubject line mentioned sparse, but it was too long ... ;-)\n\nThanks!\n\nATB,\nRamsay Jones\n"}]}