Include limits.h for PATH_MAX. [PATCH]
Shaun Jackman
sjackman at gmail.com
Tue Nov 22 15:21:42 UTC 2005
2005/11/22, Rob Landley <rob at landley.net>:
> If there are going to be strange #include dependencies that don't show up for
> the rest of us, could you fix them in busybox.h or libbb.h and #include that
> instead?
>
> Eventually I'd like to have some kind of platform.h file that this kind of
> knowledge is centralized in. Otherwise we'll never be able to spot
> regressions...
>
> Rob
Since libbb/find_root_device.c uses PATH_MAX, it must include
limits.h. If the header file is not included, what mechanism do you
expect to provide the symbol? We've had a similar discussion before
[1]. I feel as if I'm repeating myself.
I am strongly against creating a my-headers.h that simply includes all
the standard header files, when it's clearly defined which standard
headers provide which standard symbols, such as limits.h provides
PATH_MAX.
The case of non-standard symbols, such as makedev [2], is an entirely
different matter. I'm all for providing a makedev.h that includes the
correct header to ensure a non-standard symbol is provided.
The unfortunate nature of cross-compiling is that it is impossible to
test for regressions without compiling for that specific target. All
you can do is make a best-effort and allow users of that target to
provide patches.
Cheers,
Shaun
[1] http://www.busybox.net/lists/busybox/2005-July/015080.html
[2] http://www.busybox.net/lists/busybox/2005-April/014089.html
More information about the busybox
mailing list