[PATCH] standardize on KERNEL_VERSION(a,b,c) test
Rob Landley
rob at landley.net
Fri Mar 31 19:40:17 UTC 2006
On Friday 31 March 2006 8:39 am, Robert P. J. Day wrote:
> On Thu, 30 Mar 2006, Rob Landley wrote:
> > On Thursday 30 March 2006 10:33 am, Robert P. J. Day wrote:
> > > as it stands now, i think the BB header files are unnecessarily
> > > confusing simply because they're nested. if you take a quick look
> > > at, say, libbb.h, it starts off with:
> > >
> > > #include <stdio.h>
> > > #include <stdlib.h>
> > > #include <stdarg.h>
> > > #include <sys/types.h>
> > > #include <sys/stat.h>
> > > #include <termios.h>
> > > #include <stdint.h>
> >
> > It needs to include at least a decent chunk of those for types uses
> > as function arguments or global variables. Once youv'e got enough
> > of them, quibbling about the rest becomes a bit silly.
>
> assuming i understand what you're saying here, i don't agree. sure,
> "libbb.h" needs all of those header includes *now*. but who's to say
> it always will?
>
> as it stands, a *lot* of the source files currently don't bother
> including what would normally be required system header files just
> because they count on getting those inclusions via "libbb.h". so, one
> day, "libbb.h" is restructured to not include that header file anymore
> and, suddenly, lots of stuff breaks.
If you want to rearrange the header includes, I don't really object. I don't
really care one way or the other, having one uber-#include works for me, and
having each file #include what it needs works for me. Pick one.
Of course your way I can add in five extra random #includes and we'll never be
able to prove they're _not_ needed. That way lies madness too.
> for cleanliness, i don't think any source file should count on getting
> its *system* header files via a *local* header file inclusion. even
> if it's redundant, i'd prefer to see all source files explicitly
> include all of the system header files they would normally need.
Why do you think it matters?
> if you don't, you're just begging to have stuff break in surprising ways
> down the road.
Show me something broken and we can fix it. You're arguing about theoretical
breakage.
> rday
Rob
--
Never bet against the cheap plastic solution.
More information about the busybox
mailing list