From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from layka.disroot.org (layka.disroot.org [178.21.23.139]) by sourceware.org (Postfix) with ESMTPS id 548523858D35 for ; Wed, 1 Nov 2023 23:28:16 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 548523858D35 Authentication-Results: sourceware.org; dmarc=pass (p=reject dis=none) header.from=disroot.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=disroot.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 548523858D35 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=178.21.23.139 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1698881306; cv=none; b=nV4PVl7AqHniMs4VFSIH4WCsrN6P0JRMio4NiIycrw1GblKOfR49WLq+mgyKDoWIhNmRZD3Y9bjQcx39KNM2xlvGQ4GzHwmQ9Z52VeC3tiOlUi+phhoXR0PJDo8Og56TCt/N4VYvPR4JXeygmFRX9nJFxAfhSFeG8cQCRIYWVsY= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1698881306; c=relaxed/simple; bh=UaBJQSGXUjdOc3BPaEpsirtjkGVSQFJgrGjpRewwsTA=; h=MIME-Version:DKIM-Signature:Date:From:To:Subject:Message-ID; b=xEJFpzj4XntgKqfPrWgNFKEAtl1hoCdQ/gZdz27zNLjPWnYo4bb8Yuuw9/ZPzWpBUO22bQm0HAYnsq5ZpT/5lNmu9SbM0ZVN3c2NjIz9cjjNBfg93uMFWdxj3hZHT/WFZyuMmENdjydhYwaPq/aGeVhRWzK4lcZSS0Q1BB0oX0k= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from localhost (localhost [127.0.0.1]) by disroot.org (Postfix) with ESMTP id 6A48841CE3; Thu, 2 Nov 2023 00:28:15 +0100 (CET) X-Virus-Scanned: SPAM Filter at disroot.org Received: from layka.disroot.org ([127.0.0.1]) by localhost (disroot.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Vk3TXMdVT6cx; Thu, 2 Nov 2023 00:28:14 +0100 (CET) MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=disroot.org; s=mail; t=1698881294; bh=UaBJQSGXUjdOc3BPaEpsirtjkGVSQFJgrGjpRewwsTA=; h=Date:From:To:Cc:Subject:In-Reply-To:References; b=cOuw8BVZL+VaAZS7p/DE6dEK2ZXxnvjkMw4oKrNe3RbRTV32ZS9fCoud7Xc6lOtZ6 UYYTuKiZf1Gc3qp5n4faUeBGze8e+mMLX91pVeMYxN/pVEUZl/lrP20cHq4w4UG/8p dPdfiTRlRl+Xv1Nb2yGr0shUuiSVHb7k9Ar8O6UJGW3UEN9iIk62L+ZH8nXGGnzlQK 0LWVL3x899gXkN4mi4dDMl46XOHhNsi/TU/GnxEczdfSiFEeCt0s22zxV3SK1Gty1T RnnZ57sqvPBRQIpaOV7rk3bsxiWn4Z+3aMmljAR1iSMQg7DPIs7ifmz0pYiNBIVyHE COE4akzhQ03gA== Date: Wed, 01 Nov 2023 23:28:14 +0000 From: peter0x44 To: Joseph Myers Cc: Gcc Subject: Re: Suboptimal warning formatting with `bool` type in C In-Reply-To: <586ce4ef-2760-3f79-627e-ca34e345319d@codesourcery.com> References: <586ce4ef-2760-3f79-627e-ca34e345319d@codesourcery.com> Message-ID: <288ea19452236f82f8f145f9b15e6335@disroot.org> X-Sender: peter0x44@disroot.org Content-Type: multipart/alternative; boundary="=_619e37d214101d6136c5142fa87773df" X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,HTML_MESSAGE,SPF_HELO_NONE,SPF_PASS,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 List-Id: --=_619e37d214101d6136c5142fa87773df Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII; format=flowed On 2023-11-01 23:13, Joseph Myers wrote: > On Wed, 1 Nov 2023, peter0x44 via Gcc wrote: > >> Why is #define used instead of typedef? I can't imagine how this could >> possibly break any existing code. > > That's how stdbool.h is specified up to C17. In C23, bool is a keyword > instead. I see, I didn't know it was specified that way. It seems quite strange that typedef wouldn't be used for this purpose. I suppose perhaps it matters if you #undef bool and then use it to define your own type? Still, it seems very strange to do this. Maybe it's something to offer as a GNU extension? Though, I'm leaning towards too trivial to be worth it, just for a (very minor) improvement to a diagnostic that can probably be handled in other ways. --=_619e37d214101d6136c5142fa87773df--