Hi Rafael, Rafael Sadowski wrote on Tue, Sep 28, 2021 at 08:22:06AM +0200: > On Mon Sep 27, 2021 at 11:20:55PM -0600, Theo de Raadt wrote:
>> Oh, like how about you try compiling a kernel after your proposed diff? >> >> in userland - >> size_t comes from sys/types.h >> or a header file which pulls in sys/types.h, and there should be >> no further new iteration added >> >> in kernel - >> size_t comes from either sys/param.h or sys/types.h, depending >> on which one a file includes >> >> What you are suggesting is completely crazy. It's akin to "all >> header files should include all other dependent header files, and >> hey maybe one day we can have a #include_all directive, eh? >> >> Absolutely no way. > Totally understandable! I have to get used with the userland/kernel > src-environment. Thanks for the explanation and sorry for the noise. By the way: some userland programs (but not all userland programs, and of course not the C library) use the same rule of thumb that "headers usually do not include headers". Some will likely regard the following level of documentation excessive, and i'm certainly not proposing to do this in more places. But it does help me personally to not lose track of what provides and uses what in a program with a large number of deeply nested data structures and a considerable number of modules that are in part independent of each other and in part call the internal APIs of the next-lower layer: https://mandoc.bsd.lv/man/mandoc_headers.3.html Making sure that not everything includes everything also helps to recognize layering violation design errors early on, usually near the beginning of the implementation phase of a new feature, sometimes before any code starts being written at all. Yours, Ingo