From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id CDE34385840F; Fri, 24 Nov 2023 13:35:30 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org CDE34385840F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1700832930; bh=D3DgmlZ7imcyr7hfO1V9SZusTegLISpUDKj9IymtLIM=; h=From:To:Subject:Date:In-Reply-To:References:From; b=x+H0XUB54+SqHKt+0MQxaOQ69pNMhTBdJtSg/RA3ywRFs8WJ+QT+nJxTfIwLuCn8M y8mbmvGYniWiJChqSndCdXTFZyyoBl14qnMKIvV5qMqC/0LMcfHop45jmAE/lP3bFe WeFPANWjrEO3AD1enktObNFjQ1OAr96dRWCalR6E= From: "xry111 at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/112699] Should limits.h in freestanding environment be self-contained? Date: Fri, 24 Nov 2023 13:35:30 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c X-Bugzilla-Version: 14.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: xry111 at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D112699 --- Comment #3 from Xi Ruoyao --- (In reply to Alexander Monakov from comment #1) > Can you clarify which file you mean? gcc/ginclude does not have a limits.= h. >=20 > 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; otherwi= se syslimits.h will just contain "#include_next ".) 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?=