From nobody Sat Aug 14 00:40:11 2021 X-Original-To: standards@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 48545174D367 for ; Sat, 14 Aug 2021 00:40:11 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GmhQz1JcPz3GDL for ; Sat, 14 Aug 2021 00:40:11 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 157F117BFE for ; Sat, 14 Aug 2021 00:40:11 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 17E0eBAs029143 for ; Sat, 14 Aug 2021 00:40:11 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 17E0eBwY029142 for standards@FreeBSD.org; Sat, 14 Aug 2021 00:40:11 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: standards@FreeBSD.org Subject: [Bug 257827] Providing _POSIX_C_SOURCE causes some C++ headers to fail Date: Sat, 14 Aug 2021 00:40:11 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: standards X-Bugzilla-Version: 13.0-RELEASE X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: cspiegel@gmail.com X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: standards@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated List-Id: Standards compliance List-Archive: https://lists.freebsd.org/archives/freebsd-standards List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-standards@freebsd.org X-BeenThere: freebsd-standards@freebsd.org MIME-Version: 1.0 X-ThisMailContainsUnwantedMimeParts: N https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D257827 Bug ID: 257827 Summary: Providing _POSIX_C_SOURCE causes some C++ headers to fail Product: Base System Version: 13.0-RELEASE Hardware: amd64 OS: Any Status: New Severity: Affects Only Me Priority: --- Component: standards Assignee: standards@FreeBSD.org Reporter: cspiegel@gmail.com Consider the following C++ program: ``` #include int main(void) { return 0; } ``` Build: ``` $ c++ -std=3Dc++98 -D_POSIX_C_SOURCE=3D200112L t.cpp In file included from /home/chris/t.cpp:1: In file included from /usr/include/c++/v1/iostream:37: In file included from /usr/include/c++/v1/ios:215: /usr/include/c++/v1/__locale:631:16: error: use of undeclared identifier 'isascii' return isascii(__c) ? (__tab_[static_cast(__c)] & __m) !=3D0 : false; ^ /usr/include/c++/v1/__locale:638:22: error: use of undeclared identifier 'isascii' *__vec =3D isascii(*__low) ? __tab_[static_cast(*__low)] := 0; ^ /usr/include/c++/v1/__locale:646:17: error: use of undeclared identifier 'isascii' if (isascii(*__low) && (__tab_[static_cast(*__low)] & __m)) ^ /usr/include/c++/v1/__locale:655:19: error: use of undeclared identifier 'isascii' if (!(isascii(*__low) && (__tab_[static_cast(*__low)] & __= m))) ^ 4 errors generated. ``` The problem (as far as I can tell) is that isascii() is an XSI extension, so will not be exposed unless _XOPEN_SOURCE is set. But then __locale directly calls isascii(), inadvertently requiring the user to set things up so that = it's exposed. I think the proper solution would be for __locale to use an intern= al version of isascii(), e.g. __isascii(), which can be exposed no matter what (since it's a reserved identifier). --=20 You are receiving this mail because: You are the assignee for the bug.=