Re: [PATCH 1/4] C: s/0/NULL/ for pointer type

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Danh Doan <congdanhqx@xxxxxxxxx> writes:

> So, to follow that idiom, this patch should be changed, too?
> https://lore.kernel.org/git/nycvar.QRO.7.76.6.2004101604210.46@xxxxxxxxxxxxxxxxx/

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-Wen
>
>> > [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@xxxxxxxxxxxxxxxxxxxx/



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux