Re: [PATCH 1/4] C: s/0/NULL/ for pointer type
From: Junio C Hamano <hidden>
Date: 2020-04-24 01:54:14
Danh Doan [off-list ref] writes:
So, to follow that idiom, this patch should be changed, too? https://lore.kernel.org/git/nycvar.QRO.7.76.6.2004101604210.46@tvgsbejvaqbjf.bet/ (local)
I didn't look at that patch carefully, but it seems that it changes
struct foo variable_to_be_initialized = {};
into various forms, e.g.
struct foo variable_to_be_initialized = { NULL };
struct foo variable_to_be_initialized = { { NULL } };
depending on the actual shape of 'foo', and that old thread explains
that it is sufficient to consistently write "= { 0 };".
Having said that, if I recall correctly, Dscho suggested even larger
style fixes to the code, so if that were to happen, the above initializer
fix may just be lost in the noise ;-)
Thanks.
+Cc: Dscho and Han-Wenquoted
quoted
[Luc, this topic came up on the sparse and kernel mailing-lists at one point, but I didn't get around to posting my patch to the list - something came up. Hopefully, I will find some time to find it and post it soon.][References] *1* https://lore.kernel.org/git/e6796c60-a870-e761-3b07-b680f934c537@ramsayjones.plus.com/ (local)