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.129.124]) by sourceware.org (Postfix) with ESMTPS id 6BDF23858C74 for ; Tue, 4 Oct 2022 18:05:34 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 6BDF23858C74 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=1664906734; 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=i4uNnXDgC2/FHXQ5tJ24z4wJRIFDFQJmWpKZInG6MkpwXqe+mACNBAXbnG7wZ8TeV+Fg78 pD2OLUBjPbOCgXWTQd/Ogzsntb7KnlSx4C8o+EF2NUe0CBRq9+j3bHn63iB5MBBs+sl3X/ mhNx9qE1X4ATOEKYkgADGvKKamqPKvs= Received: from mail-qk1-f198.google.com (mail-qk1-f198.google.com [209.85.222.198]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-269-8o8kUDM4NWWbTD8g3z4eVg-1; Tue, 04 Oct 2022 14:05:32 -0400 X-MC-Unique: 8o8kUDM4NWWbTD8g3z4eVg-1 Received: by mail-qk1-f198.google.com with SMTP id n13-20020a05620a294d00b006cf933c40feso12450268qkp.20 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=xbDIXBo04eNS7nu8/VFBgdXJnpYY32z/eIlynTiecVtT3q4NAvW/rRx7vI+i+5Dt7s eQqTSEdjUj65uEArFCLY/QH5DGX3idXbb9uyjQDWuHv2kpiQ0boOUB3QOTD4aJ+HMKXS YfikGqlxkHqPXIJl2E1OukPG31B8HigDavwbcbKvAgZDU+9MMEdHGgMHpxcsDzFdvF9l 8yh3ghhY+PB4piHea1F+34g9JV4JJKPamcT+qaYp8TY17a9i7DzU2+klEoYkomqBBXDe 3/ZmjZFPSKejVoJIiBSN/6WXJzdUh7K5qRVEsvni9IIKUIY1Oq5tP9rkwtC5a21UkyhS EANg== X-Gm-Message-State: ACrzQf3suCl/67dBwKchmchOApGOTz6oRK2FMxsaNB967fGwHx+8KWKD 4rGAZr7mG8uBME22+TEYBL7P8iLtrT+x0ewqqka+XAFxnNAp/DwBYyoNwUf3wrf4u7oJg5SYPeK eM1w+cT4EnIk8W7GSh9i1naOFHlZyuFU= X-Received: by 2002:a05:620a:28c5:b0:6ce:bc17:15b0 with SMTP id l5-20020a05620a28c500b006cebc1715b0mr17591677qkp.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.9 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE,SPF_NONE,TXREP autolearn=ham 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 ...