Commit a7e475b
committed
clang/limits.h: Avoid including limits.h twice
The limits.h of glibc, aka /usr/include/limits.h file of *-linux-gnu
systems, has `#include_next <limits.h>`, so the limits.h from clang
is included.
And in the limits.h for clang, `#include_next <limits.h>` is also
used.
Normally it won't be a problem as the headers is protected by something
like _LIBC_LIMITS_H_, while it may be a problem when we cross-build
glibc on a none glibc platform. For example if we build glibc for
x86_64-linux-gnu on a x86_64-linux-musl platform.
To test it, we can do
```
echo "#include </usr/include/limits.h>" | bin/clang -E -O2 -xc - -MM -H
```
We can see there is
```
. /usr/include/limits.h
.. /usr/lib/llvm-19/lib/clang/19/include/limits.h
... /usr/include/limits.h
```1 parent 104ad92 commit a7e475b
1 file changed
+3
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
24 | | - | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
25 | 26 | | |
26 | 27 | | |
27 | 28 | | |
| |||
0 commit comments