From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm1-x335.google.com (mail-wm1-x335.google.com [IPv6:2a00:1450:4864:20::335]) by sourceware.org (Postfix) with ESMTPS id 416983858404; Wed, 19 Jan 2022 15:21:30 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 416983858404 Received: by mail-wm1-x335.google.com with SMTP id ay14-20020a05600c1e0e00b0034d7bef1b5dso8119546wmb.3; Wed, 19 Jan 2022 07:21:30 -0800 (PST) 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=n+hYe/JFKq41VfXzzHnMF83/+coIAU4o9iaT8bDYlYo=; b=hO/TdYG+ULUbmiE4a/XcFTQfFaQZN0KW2LEQq0FjHdOlOWRptVwCAxUjIDEUTTKsw8 faX5PMizV2eD2DmYHehYi2F3FI7DEbkDsEvooo6Pf7WwSOXLKCcBgaWJtOXEkXoyV3z5 aJq6YRxo07y6mZjIPXLd1HVlP8koGxnZL1AeMOcsmmtvI+SyhFkc1zNr67wJJ8lXj+i3 OUC7jyMu2LEblDtNbTClk81xT2ivWZHjKJSQNSQ+aZjs7McOFV8fQceD0Bp+89eYzyws 6I8rR39wML9U5hBMvwVsEHNlWnaihS4jGGgtc8Hb7swHGrkrLX0BnRR8iqrJnRiLCZpG ViNg== X-Gm-Message-State: AOAM531qOGfHouUFTHCJtvJzabRDVZjTT0k5UzW6R6xAeSlS+ZV7TpyF IO8UZ57DqWLiweEotvymIHXCQImd/KNSBOHRyFk= X-Google-Smtp-Source: ABdhPJyK8jSNjFllHFpsEp9S4HtSfZLLFwk6AMNKi8MYGpBXzvQ0vBJNoSeqnDH9Gsy8zISdXfe3OZb84Bvx8DL01cE= X-Received: by 2002:a7b:c310:: with SMTP id k16mr4046810wmj.169.1642605689348; Wed, 19 Jan 2022 07:21:29 -0800 (PST) MIME-Version: 1.0 References: <2169197.iZASKD2KPV@minbar> <8881104.CDJkKcVGEf@minbar> In-Reply-To: <8881104.CDJkKcVGEf@minbar> From: Jonathan Wakely Date: Wed, 19 Jan 2022 15:21:15 +0000 Message-ID: Subject: Re: [PATCH] libstdc++: Fix for non-constexpr math_errhandling To: Matthias Kretz Cc: gcc-patches , "libstdc++" X-Spam-Status: No, score=-1.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, HTML_MESSAGE, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: libstdc++@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libstdc++ mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Jan 2022 15:21:31 -0000 On Wed, 19 Jan 2022, 12:45 Matthias Kretz, wrote: > On Wednesday, 19 January 2022 13:07:26 CET Jonathan Wakely wrote: > > On Wed, 19 Jan 2022 at 08:10, Matthias Kretz wrote: > > > Follow-up to my last patch. This one is a more thorough fix. Tested on > > > x86_64- > > > linux. OK for trunk? > > > > > > ---- 8< ---- > > > > > > Use SFINAE magic to support: "It is unspecified whether > math_errhandling > > > is a macro or an identifier with external linkage." [C Standard] > > > > The patch is OK for trunk, but I don't understand what the C standard > means > > here. > > > > "the macro math_errhandling expands to [...]. It is unspecified whether > > math_errhandling is a macro or an identifier with external linkage." > > > > So is it a macro or not? > > I agree the quote I used is unclear. The complete paragraph: > > The macros > > MATH_ERRNO > MATH_ERREXCEPT > > expand to the integer constants 1 and 2, respectively; the macro > > math_errhandling > > expands to an expression that has type int and the value MATH_ERRNO, > MATH_ERREXCEPT, or the bitwise OR of both. The value of math_errhandling > is > constant for the duration of the program. It is unspecified whether > math_errhandling is a macro or an identifier with external linkage. If a > macro > definition is suppressed or a program defines an identifier with the name > math_errhandling, the behavior is undefined. If the expression > math_errhandling & MATH_ERREXCEPT can be nonzero, the implementation shall > define the macros FE_DIVBYZERO, FE_INVALID, and FE_OVERFLOW in > . > But that still says "the macro math_errhandling" and then says it might not be a macro. I'll ask some WG14 people for clarity, but it doesn't affect your patch.