[Bug c/112699] Should limits.h in freestanding environment be self-contained?
xry111 at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Fri Nov 24 13:35:30 GMT 2023
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112699
--- Comment #3 from Xi Ruoyao <xry111 at gcc dot gnu.org> ---
(In reply to Alexander Monakov from comment #1)
> Can you clarify which file you mean? gcc/ginclude does not have a limits.h.
>
> I assume you are not talking about the fixinclude'd limits.h?
No, I mean the limits.h in $(dirname $(gcc -print-libgcc-file-name)). It
currently contains these lines to include libc limits.h:
#ifndef _LIBC_LIMITS_H_
/* Use "..." so that we find syslimits.h only in this same directory. */
#include "syslimits.h"
#endif
(if libc limits.h is fixinclude'd, it will be saved to syslimits.h; otherwise
syslimits.h will just contain "#include_next <limits.h>".)
And I'm asking if
#ifndef _LIBC_LIMITS_H_ && !__STDC_HOSTED__
/* Use "..." so that we find syslimits.h only in this same directory. */
#include "syslimits.h"
#endif
would be better?
More information about the Gcc-bugs
mailing list