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 C4917395BC3E for ; Fri, 13 May 2022 17:41:55 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org C4917395BC3E Received: from mail-yw1-f199.google.com (mail-yw1-f199.google.com [209.85.128.199]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-643-ZlHBonSNOgeZ-6Q90eGIhw-1; Fri, 13 May 2022 13:41:54 -0400 X-MC-Unique: ZlHBonSNOgeZ-6Q90eGIhw-1 Received: by mail-yw1-f199.google.com with SMTP id 00721157ae682-2f7ee6bc6ddso78411207b3.1 for ; Fri, 13 May 2022 10:41:54 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=EUKoK+Ef4z4ZO4M7BKFbIHkZ0fRqnqxim9lQOOoISCs=; b=XyEilCoq4ZtLw8mSe6V4S9vwEEsAK1xb/+LIUsuotrXZ2JeQZcIC7YQour7iGx71/N LnkiC64CnAKBRY+wf73bjTR5dGUCXRnnISYbIf/8fna0XF9JXDH+C1Qp7gbNYmF+inKk BuVEAG9I+lwM6bbhe5cY98bpBG6YzMkicyAHko0iW/Z7EfmtjJ7xn4b6pHhboYeRE045 T6qqSY2shSSzilcnm+CoqE8225HSmCv9olz7JtK0Ctj99FrhXESyLDhG4/v3ZKbalLJB hQSuVWw/rB0cS8DOfugl5uJMZkDYzVzgTFHRbb/iFQZTirI5RvjgIBLqaFoxYTo5F1QU LaRw== X-Gm-Message-State: AOAM531AGHbApJJ6t1pD7Our3kJGVIU2GDIHiAFzJgvLcmd4YIhm5Ytk vhmbC8IZKwDG0uXenQQw8swIV37Cr136AS5JG24TuUjkvKimPB7kVS2riuirMnVR2YahsFn5lgs Lg/Km6Cu3nGj1RdQlFb/2gr2lCZq58V0A1HVt X-Received: by 2002:a81:3dc7:0:b0:2f8:d488:cf00 with SMTP id k190-20020a813dc7000000b002f8d488cf00mr6723001ywa.229.1652463714008; Fri, 13 May 2022 10:41:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxlcXIDNRKOW/lF/OvZFarLTlsOAXpFbGUt+H7/jzqRPBm7cGax7BolNRJ2GdKKT85srM9DJRdVlZpObGxVizM= X-Received: by 2002:a81:3dc7:0:b0:2f8:d488:cf00 with SMTP id k190-20020a813dc7000000b002f8d488cf00mr6722992ywa.229.1652463713804; Fri, 13 May 2022 10:41:53 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Jonathan Wakely Date: Fri, 13 May 2022 18:41:42 +0100 Message-ID: Subject: Re: [PATCH] Check for ISO C compilers should also allow C++ To: Joseph Myers Cc: GNU C Library , "Carlos O'Donell" , Florian Weimer X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-7.1 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, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 May 2022 17:41:57 -0000 On Fri, 13 May 2022 at 18:28, Joseph Myers wrote: > > On Fri, 13 May 2022, Jonathan Wakely via Libc-alpha wrote: > > > Tested x86_64-linux. > > > > There is a suggestion[1] to make clang++ stop defining __STDC__ but it's > > blocked by this. The clang++ change will still be blocked while old > > Glibc versions are still in use, but we can start the clock ticking by > > fixing Glibc now. > > > > [1] https://discourse.llvm.org/t/rfc-stop-defining-the-stdc-and-related-macros-in-c-mode/62468/1 > > > > >From a quick grep, I don't think any other places in Glibc need a > > similar change. Florian pointed out that gnulib overrides > > and so should make the same change in its version. > > The change seems sane. While we don't document what extensions (beyond > C90 / C++98) are needed to use glibc's headers (e.g. long long, flexible > array members, anonymous structs / unions; in at least some cases, > alignment attributes and asm redirection of functions), I see no reason > defining __STDC__ in C++ should be such a required extension. Right. Its meaning in ISO C++ is entirely implementation-defined, and G++ doesn't document any particular meaning for it, and clang++ doesn't either AFAIK, and follows a slightly different set of rules for when it's defined (see the link above). So in C++ the only thing that __STDC__ being defined tells you is that __STDC__ is defined :-) That's not a very useful thing to test for in isolation.