From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id CA8D53858422 for ; Tue, 4 Oct 2022 18:05:35 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org CA8D53858422 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1664906735; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=O/jSC0yzfP7rxTbAh6lVnA0Z6loTNE3e1FwHf3VQZxU=; b=SHwuSC9rhNC8HoB9f5jrKIO4rxnFZto2D8sl/08oGZN1GDFFGGgCX4AhE5+AQOm+xBKk4w eebkTlYHesuBzGoxxE2Kw7NAFcG+z7mkdDadII+eU1aDOpJYvSynJEIKoDi3+RgZ+cRFmo v+HpSo3viEFdyr/SFqLtWioIeFaanrE= Received: from mail-qv1-f70.google.com (mail-qv1-f70.google.com [209.85.219.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-608-CFkNiy-iPYmrvrhFi0Z4XQ-1; Tue, 04 Oct 2022 14:05:32 -0400 X-MC-Unique: CFkNiy-iPYmrvrhFi0Z4XQ-1 Received: by mail-qv1-f70.google.com with SMTP id i10-20020ad45c6a000000b004a25d0fea96so9237350qvh.3 for ; Tue, 04 Oct 2022 11:05:32 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date; bh=O/jSC0yzfP7rxTbAh6lVnA0Z6loTNE3e1FwHf3VQZxU=; b=KOw/GgxPuYHQYcFhOpjOp3g0jkVnCb65jDK1VCJdXwP7GOaFUCmHRW4oS2mB5aAytM q2hE+yaUKxJ/mfB6GF8nFKDvALO1GpNxbmbNTPZP131XjImIzyQbjtTrlXSellZ6tuJf pwA6qg1XANQ5MZZjTRCZP/eMnnmS0c2Njl9VpgXrYnrgfunuMtZ6JdwtSpXGE2rg4g6c 5LRC+6uKVjaPQ9fG/smid6kVUXOPwZBHh8XRkfAY3+6KbmXi2YFiMrlT5xGC6HIJU1VP EuxadY9jpdDr8u695NKBABNwzfl1dU9q5a/E8uOwxUZUEEQRR5tGbHh6g1NuATc/D/sO tkww== X-Gm-Message-State: ACrzQf35NoyQA7yzMhZV4nsaPWk8towlYqfyWnP5SJqwS1WB2S1OleEa Ua32g61qUVV3a0e6WJvmHeJ9S/3iDe/lSbt3Jtr1YzCGKc6mi39XXn/+kSgrWufGHy8CvU8eQou 0tvKgoqMsb6E7O/O0NVXxOnTRlCbnkswn7w== X-Received: by 2002:a05:620a:28c5:b0:6ce:bc17:15b0 with SMTP id l5-20020a05620a28c500b006cebc1715b0mr17591678qkp.245.1664906732129; Tue, 04 Oct 2022 11:05:32 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4XwjsBPekPme7ycWkBAJ/451PZnU1dRpiWQvt1362/CfGQbp2kTupb28J44Y+gMzMDyP2lKEzJmHAtUcKUV3w= X-Received: by 2002:a05:620a:28c5:b0:6ce:bc17:15b0 with SMTP id l5-20020a05620a28c500b006cebc1715b0mr17591661qkp.245.1664906731908; Tue, 04 Oct 2022 11:05:31 -0700 (PDT) MIME-Version: 1.0 References: <20221004165109.559028-1-jwakely@redhat.com> In-Reply-To: <20221004165109.559028-1-jwakely@redhat.com> From: Jonathan Wakely Date: Tue, 4 Oct 2022 19:05:21 +0100 Message-ID: Subject: Re: [RFC] libstdc++: Generate error_constants.h from [PR104883] To: Jonathan Wakely Cc: libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-6.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_NONE,TXREP autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On Tue, 4 Oct 2022 at 17:51, Jonathan Wakely via Libstdc++ wrote: > > Does anybody see any issues with generating the list of error numbers at > build time? > > > -- >8 -- > > Instead of having several very similar target-specific headers with > slightly different sets of enumerators, generate the error_constants.h > file as part of the build. This ensures that all enumerators are always > defined, with the value from the corresponding errno macro if present, > or a libstdc++-specific alternative value. > > The libstdc++-specific values will be values greater than the positive > integer _GLIBCXX_ERRC_ORIGIN, which defaults to 9999 but can be set in > os_defines.h if a more suitable value exists for the OS (e.g. ELAST > could be used for BSD targets). ... > +${CXXCPP} -P -D_POSIX_C_SOURCE=200809L -x c++ "$constants_h" \ > + | sed -e '1,/^GLIBCXX ERROR CONSTANTS BELOW HERE$/d' \ > + >> "$output_h" || exit $? Gah, this is the wrong version of the script! It's supposed to replace unexpanded EXXX tokens with __LINE__ (which is why #line is used to set the origin) but I seem to have committed the wrong version. Let me dig that out of my git reflog ...