[PATCH] sockaddr.3type: Document that sockaddr_storage is the API to be used

Zack Weinberg zack@owlfolio.org
Fri Apr 14 16:08:26 GMT 2023


On 2023-04-06 3:37 PM, Eric Blake wrote:
> Since Issue 7 is tied to C99, and Issue 8 will be tied to C17, both of
> which use the same section number despite being a different edition of
> the C standard, being that specific may work.  Or, we might try
> something focusing more on wording instead of document location, as
> in:
> 
> Additionally, the structures shall be defined in such a way that the
> compiler treats an access to the stored value of the sa_family_t
> member of any of these structures, via an lvalue expression whose type
> involves any other one of these structures, as permissible even if the
> types involved would not otherwise be deemed compatible with the
> effective type of the object ultimately being accessed.

I quite like this way of putting it.  It subsumes both what I wrote and 
the related potential headache with deciding whether the sa_family_t 
field is considered an object or just a range of bytes within a larger 
object.

zw


More information about the Libc-alpha mailing list