struct definition inside a function

Anuz Pratap Singh Tomar chambilkethakur at gmail.com
Tue Nov 29 10:06:30 EST 2022


Hi all,
I have not seen a struct define inside a function in kernel code and
couldn't find any guidelines if it's permitted or frowned upon?

int fn(int i)
{
 struct my_struct {
int var1;
int var2
}; /* is this allowed? */
struct my_struct struct_local;


return 0;
}
I'll appreciate any insight on this?
-- 
Thank you
Regards
Anuz
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20221129/65d52cd1/attachment.html>


More information about the Kernelnewbies mailing list