[clang] clang/limits.h: Avoid including limits.h twice (PR #120526)

Aaron Ballman via cfe-commits cfe-commits at lists.llvm.org
Wed Jan 22 05:19:44 PST 2025


AaronBallman wrote:

> > > > Yes and no. It's due to the redefinitions, for sure. But that diagnostic is suppressed in system headers: https://godbolt.org/z/Mb7Kh975f, so I think we need to understand why there's a `limits.h` being included as though it were not a system header, because that's a bug.
> > > 
> > > 
> > > As we are building `glibc`, in which it includes the `limits.h` of itself, instead of the system one.
> > 
> > 
> > That's the bug then. It needs to include the header as a system header, not a user header.
> 
> Yes. It does. It uses `-I` option to include limits.h of itself. 

Do you get the same behavior when you use `-isystem` instead?



https://github.com/llvm/llvm-project/pull/120526


More information about the cfe-commits mailing list