From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from esa4.mentor.iphmx.com (esa4.mentor.iphmx.com [68.232.137.252]) by sourceware.org (Postfix) with ESMTPS id 4B4B23939C15 for ; Wed, 13 Jan 2021 18:09:17 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 4B4B23939C15 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=codesourcery.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=joseph_myers@mentor.com IronPort-SDR: nj4T/9tDJALJU0kIytYgzEVRZfktrgsLuRrHcTMwTZNmEaWLPsc5vlePED5Utg/RvebuJoU8jG 1nYRuvTdnFNqEQMir5L+YnNzd0KS9TbTAcu/02XtUKrahm7cGPZyWHH9j+y9SEKAJd9SlUcrKo RetnoN78LV1m3egQc4YEvUzVuLVc0Piz2ylHwmsjHh9/EoxHeO/xEb+e8NsUu48LAFxoHNBDHO EUAekaDfW5vbXfHgoLaqzWoA8guIhB8UVgJELGfNO6dcaSI52bowVt93gyEa6S8yti1sNlT2i8 v04= X-IronPort-AV: E=Sophos;i="5.79,344,1602576000"; d="scan'208";a="57177922" Received: from orw-gwy-02-in.mentorg.com ([192.94.38.167]) by esa4.mentor.iphmx.com with ESMTP; 13 Jan 2021 10:09:16 -0800 IronPort-SDR: 2F0CcrVHq5omRIpn/V7HgC/F93lnlbbpi8LVQjWB8g50/P0skHQ6FgUeAMdFmelvaM5hxmbjt/ AZr1NUz+upJFz3QbP4/lYs0QCxXyyUlvyp+S2Pz4/pl9EyWiESGUDtJsKKkZqmeiv0ORaulQLF Ezg5A3h8hDQS3YK78pV2B/X+yRoIjlMO+ydh4o1697+NP8TMdaYVPhJtdoOIh7iwrv0t3Gnplq XOZ9eG8djwkvmTDmf4zLkSFoeFoFBHyeLt42CVqkCk4og29/wlmOHt2qLBDJ1dlbt4hsuQk5Ly Eow= Date: Wed, 13 Jan 2021 18:09:10 +0000 From: Joseph Myers X-X-Sender: jsm28@digraph.polyomino.org.uk To: Adhemerval Zanella CC: Subject: Re: [PATCH 1/5] misc: Sync cdefs.h with gnulib In-Reply-To: <20210113165826.1014708-1-adhemerval.zanella@linaro.org> Message-ID: References: <20210113165826.1014708-1-adhemerval.zanella@linaro.org> User-Agent: Alpine 2.22 (DEB 394 2020-01-19) MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" X-Originating-IP: [137.202.0.90] X-ClientProxiedBy: SVR-IES-MBX-08.mgc.mentorg.com (139.181.222.8) To svr-ies-mbx-01.mgc.mentorg.com (139.181.222.1) X-Spam-Status: No, score=-3124.1 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) 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: Wed, 13 Jan 2021 18:09:18 -0000 On Wed, 13 Jan 2021, Adhemerval Zanella via Libc-alpha wrote: > +#if defined __STDC_VERSION__ && 201710L < __STDC_VERSION__ > +# define __attribute_maybe_unused__ [[__maybe_unused__]] I don't think that will work with GCC 9 -std=c2x or -std=gnu2x (support for [[]] attributes was added in GCC 10). This macro isn't used at all in glibc, what compilers and options are expected to be supported for it in gnulib? If you compare __STDC_VERSION__ with the version for the previous standard, and intend to support compilers such as GCC 9 -std=gnu2x, you need to deal with incomplete implementations using placeholder values (202000L in this case). (You might have incomplete implementations even comparing with the final value used for C23, but they're less likely to be so incomplete.) When you're supporting [[__maybe_unused__]] you might want to support it for C++17 as well as C2x. Or is this macro in gnulib only intended to be used in C code, not C++? -- Joseph S. Myers joseph@codesourcery.com