How to tell if a field in c struct is initialized?

Shiyao MA i at introo.me
Fri Dec 8 07:47:42 EST 2017


Hi,

I come across this code:
http://elixir.free-electrons.com/linux/latest/source/drivers/scsi/scsi_netlink.c#L128

other fields such as .cbmutex, .bind, etc are not initialized.

Since the object =cfg= is of automatic storage, I wonder how the
kernel tells if a field is initialized or its value is just some
random bits on the stack?

-- 
Best,
Shiyao



More information about the Kernelnewbies mailing list