From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 042B33858438; Thu, 22 Sep 2022 10:47:17 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 042B33858438 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1663843638; bh=Zp+jHRDSWU+gdGG0NnjAcNFKj9baUBoIIyzleZrDxWI=; h=From:To:Subject:Date:In-Reply-To:References:From; b=iN/elcr1WhQP1pC4XIk+LzpxOpwxN4eaQwfCdIfkovi3qnZ0bPR/OqeuOVS6IIhR2 dhqBV/+hnMH7zoKI1TEO9CSkERF83GHc4T4W2bvHvHeV4mObXjiqGn/AanXwTz8PMD t6Y7Ucb+dUjhQF9sF7v9xSQsuqMDDAQCWRA3rfW0= From: "redi at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/104883] should define all std::errc enumerators Date: Thu, 22 Sep 2022 10:47:17 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: libstdc++ X-Bugzilla-Version: 12.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: redi 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=3D104883 --- Comment #1 from Jonathan Wakely --- >From PR 1007008 comment 2: -- >8 -- We could do something like this for each enumerator: #ifdef EFOO foo =3D EFOO, #else foo =3D _GLIBCXX_ERRC_ORIGIN + __LINE__, #endif Where _GLIBCXX_ERRC_ORIGIN is some value intended to be higher than the hig= hest errno value on the OS. We only need fewer than 100 errc enumerators so INT_MAX/2 might be OK. We can use #line to set the __LINE__ to a fixed value in the file, so that = the constants don't change if we add/remove lines before the errc definition. -- >8 -- We can use a default _GLIBCXX_ERRC_ORIGIN value, and allow it to be overrid= den in config/os/*/os_defines.h if the default doesn't work.=