miconda left a comment (kamailio/kamailio#4781)

The memset() is used in many places across the code to ensure that the fields 
which are not explicitly  set after it are 0/NULL, being safer if new fields 
are added to a structure that can be used/initialised in many parts of the 
code. There are many initialisations like that all over the code.

Designated field initialisation on declaration (introduced in C99) should 
ensure that the other fields (not initialised explicitly by name) are 
initialised by the compiler, but that might not be as a block of zeros. I 
haven't checked if all compilers comply and from what version.

I was calling for other developers to express their opinion before deciding to 
merge. I see it more like a cosmetic change (that can be applied in many other 
parts of code), rather than a real necessity.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/4781#issuecomment-4855244530
You are receiving this because you are subscribed to this thread.

Message ID: <kamailio/kamailio/pull/4781/[email protected]>
_______________________________________________
Kamailio - Development Mailing List -- [email protected]
To unsubscribe send an email to [email protected]
Important: keep the mailing list in the recipients, do not reply only to the 
sender!

Reply via email to