Re: [PATCH net-next] net: uapi: Provide an UAPI definition of 'struct sockaddr'

From: Florian Weimer

Date: Mon Jan 12 2026 - 08:25:36 EST


* Thomas Weißschuh:

>> If you call the data member sa_data just like glibc, it will only fail
>> in C++, not C. GCC considers the two definitions sufficiently
>> equivalent (even though glibc adds a may_alias attribute to meet POSIX
>> requirements), and duplicate definitions are permitted in C.
>
> clang is not so lenient and will error out.

It seems it accepts it if you switch to C23 mode.

Thanks,
Florian