Thread (1 message) 1 message, 1 author, 2026-01-12

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

From: Florian Weimer <hidden>
Date: 2026-01-12 13:37:25
Also in: lkml, netdev

* Thomas Weißschuh:
On Mon, Jan 12, 2026 at 02:25:25PM +0100, Florian Weimer wrote:
quoted
* Thomas Weißschuh:
quoted
quoted
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.
The currently supported baseline for UAPI headers is C90.
We can't really force userspace to switch here.
Including libc and UAPI headers at the same time is still officially
unsupported, right?

We don't test for it, so lots of combinations do not work.

Thanks,
Florian
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help