I went back to the first patch in LKML for this series.
It seems your goal is that every include file should be standalone,
i.e it must include every definition it uses.
I disagree with this premise. It just makes things harder to maintain with
no real gain for any existing program. What is the motivation for all this
useless churn? Is there some silly style rule that should be fixed instead?
From: David Miller <davem@davemloft.net> Date: 2016-08-22 23:26:49
From: Stephen Hemminger <stephen@networkplumber.org>
Date: Mon, 22 Aug 2016 12:37:45 -0700
It seems your goal is that every include file should be standalone,
i.e it must include every definition it uses.
I think this is absolutely mandatory Stephen. If you include x.h
it should just work if you use the interfaces x.h defines.
No user should have to know about dependencies, that is exactly the
job of the header file itself.
I went back to the first patch in LKML for this series.
It seems your goal is that every include file should be standalone,
i.e it must include every definition it uses.
I disagree with this premise. It just makes things harder to maintain with
no real gain for any existing program. What is the motivation for all this
useless churn? Is there some silly style rule that should be fixed instead?
With over 700 uapi headers exported to userspace by Linux kernel, how
do I find out the 'correct' order of including them if they can not be
included alone? Any hints on automating that?
My first trial was to include all of the uapi headers as a single bunch to
abi checker tool which calls gcc on them, but the compilation result was
so bad and hopeless that I decided to try feeding each header file one by
one to the compiler and here I am over two years later still fixing these
issues.
I came up with the rule because to me it makes sense. Several kernel
devs agree with this approach and have accepted patches.
If your kernel subsystem uapi headers have a single entry point header file,
then all of the others can just depend on that and be done with it.
For example most (if not all) drm driver specific headers include <drm/drm.h>.
-Mikko