public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/112699] New: Should limits.h in freestanding environment be self-contained?
@ 2023-11-24 10:36 xry111 at gcc dot gnu.org
2023-11-24 11:15 ` [Bug c/112699] " amonakov at gcc dot gnu.org
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: xry111 at gcc dot gnu.org @ 2023-11-24 10:36 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112699
Bug ID: 112699
Summary: Should limits.h in freestanding environment be
self-contained?
Product: gcc
Version: 14.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
Assignee: unassigned at gcc dot gnu.org
Reporter: xry111 at gcc dot gnu.org
Target Milestone: ---
Currently limits.h always includes the libc limits.h if it's available at build
time. Should it be self-contained instead like stdint.h with -ffreestanding?
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug c/112699] Should limits.h in freestanding environment be self-contained?
2023-11-24 10:36 [Bug c/112699] New: Should limits.h in freestanding environment be self-contained? xry111 at gcc dot gnu.org
@ 2023-11-24 11:15 ` amonakov at gcc dot gnu.org
2023-11-24 11:24 ` amonakov at gcc dot gnu.org
2023-11-24 13:35 ` xry111 at gcc dot gnu.org
2 siblings, 0 replies; 4+ messages in thread
From: amonakov at gcc dot gnu.org @ 2023-11-24 11:15 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112699
Alexander Monakov <amonakov at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |amonakov at gcc dot gnu.org
--- Comment #1 from Alexander Monakov <amonakov at gcc dot gnu.org> ---
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?
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug c/112699] Should limits.h in freestanding environment be self-contained?
2023-11-24 10:36 [Bug c/112699] New: Should limits.h in freestanding environment be self-contained? xry111 at gcc dot gnu.org
2023-11-24 11:15 ` [Bug c/112699] " amonakov at gcc dot gnu.org
@ 2023-11-24 11:24 ` amonakov at gcc dot gnu.org
2023-11-24 13:35 ` xry111 at gcc dot gnu.org
2 siblings, 0 replies; 4+ messages in thread
From: amonakov at gcc dot gnu.org @ 2023-11-24 11:24 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112699
--- Comment #2 from Alexander Monakov <amonakov at gcc dot gnu.org> ---
Sorry, even though GCC's limits.h is installed under include-fixed, it is
generated separately, not by the generic fixincludes mechanism. I was confused.
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug c/112699] Should limits.h in freestanding environment be self-contained?
2023-11-24 10:36 [Bug c/112699] New: Should limits.h in freestanding environment be self-contained? xry111 at gcc dot gnu.org
2023-11-24 11:15 ` [Bug c/112699] " amonakov at gcc dot gnu.org
2023-11-24 11:24 ` amonakov at gcc dot gnu.org
@ 2023-11-24 13:35 ` xry111 at gcc dot gnu.org
2 siblings, 0 replies; 4+ messages in thread
From: xry111 at gcc dot gnu.org @ 2023-11-24 13:35 UTC (permalink / raw)
To: gcc-bugs
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?
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2023-11-24 13:35 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-11-24 10:36 [Bug c/112699] New: Should limits.h in freestanding environment be self-contained? xry111 at gcc dot gnu.org
2023-11-24 11:15 ` [Bug c/112699] " amonakov at gcc dot gnu.org
2023-11-24 11:24 ` amonakov at gcc dot gnu.org
2023-11-24 13:35 ` xry111 at gcc dot gnu.org
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).