This is an archive of the discontinued LLVM Phabricator instance.

[libc] limits.h: include compiler limits if not already included

Authored by alfredfo on Aug 15 2023, 4:46 PM.



The LLVM-libc build itself will override include paths and prefer it's
own limits.h over the compiler's limits.h. Because we rely on the
compiler limits.h for numerical limits in LLVM-libc it needs to be
include_next:ed if not already included. The other method to work
around this is to define all numeric macros in place.

Signed-off-by: Alfred Persson Forsberg <>

Diff Detail

Event Timeline

alfredfo created this revision.Aug 15 2023, 4:46 PM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptAug 15 2023, 4:46 PM
alfredfo requested review of this revision.Aug 15 2023, 4:46 PM
alfredfo updated this revision to Diff 550548.Aug 15 2023, 4:48 PM


alfredfo updated this revision to Diff 550550.Aug 15 2023, 4:52 PM

move out of linux check

thesamesam accepted this revision.Aug 15 2023, 6:58 PM

This seems right. I'd normally prefer for Michael to take a look but I'll merge it to unbreak the build. We can revert it later if needed.

This revision is now accepted and ready to land.Aug 15 2023, 6:58 PM

Lgtm, it would be nice to add a comment explaining why we're checking gcc and clang limits