From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id F1BF03858438; Thu, 22 Sep 2022 10:44:12 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org F1BF03858438 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1663843452; bh=IGsGkpICver8DuCWPbyk8bUlK8z9kuLMuDRkKrSsB14=; h=From:To:Subject:Date:In-Reply-To:References:From; b=KIXe0TPIqK7NbFiCThi/1AqYnW5bVNwbl3RDTEXD3WhBKJcyb6wmYTtczSzO4csSr 4wjYyhOOagUJDgjujttTOocWecjiulZyVQICJizoRU5UtK/wECkAHtEDgDasqSY3XK 4w/9BskrRfRGE9yW1CkLwBNoPFFLIPVPA1k0M9Ps= From: "redi at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/107008] Combine config/os/*/error_constants.h into one file Date: Thu, 22 Sep 2022 10:44:12 +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.2.1 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=3D107008 --- Comment #2 from Jonathan Wakely --- A related topic is that we simply don't define the errc enumerators that do= n't have a corresponding EXXXX macro, which is non-conforming. The C++ standard says the enumerators should all be there. 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.=