tech-net archive

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

Re: patch make struct protosw pr_input non-variadic



   Date: Sat, 14 May 2016 18:22:08 -0400
   From: christos%zoulas.com@localhost (Christos Zoulas)

   On May 14,  5:28pm, rtr%netbsd.org@localhost (Tyler Retzlaff) wrote:
   -- Subject: Re: patch make struct protosw pr_input non-variadic

   | The only casts I see in the patch are those producing the address of 
   | struct protosw that are the product of a designated initialization?  Or 
   | am I missing something?

   Yes, I guess the only way to avoid those is to have static variables for
   them?

These aren't casts, per se -- they're what C99 calls compound literals
(Sec. 6.5.2.5, p. 75).  They do not indicate any sort of type punning:
it's just a way to create an anonymous structure object and get its
address as a constant initializer.  I did this to make the patch
easier to review and to avoid a proliferation of global constants.


Home | Main Index | Thread Index | Old Index