Re: [RFC] bpf.2: Use standard types and attributes
From: Zack Weinberg <hidden>
Date: 2021-04-25 19:28:17
Also in:
bpf, lkml
On Sun, Apr 25, 2021 at 12:52 PM Alexei Starovoitov via Libc-alpha [off-list ref] wrote:
On Sat, Apr 24, 2021 at 10:56 AM Alejandro Colomar (man-pages) [off-list ref] wrote:quoted
Hello Alexei, On 4/24/21 1:20 AM, Alexei Starovoitov wrote:quoted
Nack. The man page should describe the kernel api the way it is in .h file.Why?Because man page must describe the linux uapi headers the way they are installed in the system and not invent alternative implementations. The users will include those .h with __u32 and will see them in their code. Man page saying something else is a dangerous lie.
Why do you consider it _dangerous_ for the manpages to replace __u32 with uint32_t, when we know by construction that the two types will always be the same? Alejandro's preference for the types standardized by ISO C seems perfectly reasonable to me for documentation; people reading the documentation can be expected to already know what they mean, unlike the Linux-specifc __[iu]NN types. Also, all else being equal, documentation should avoid use of symbols in the ISO C reserved namespace. If anything I would argue that it is the uapi headers that should be changed, to use the <stdint.h> types. zw