From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.ispras.ru (mail.ispras.ru [83.149.199.84]) by sourceware.org (Postfix) with ESMTPS id 3AFBC3858D1E for ; Wed, 21 Dec 2022 18:52:03 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 3AFBC3858D1E Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=ispras.ru Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=ispras.ru Received: from [10.10.3.121] (unknown [10.10.3.121]) by mail.ispras.ru (Postfix) with ESMTPS id 168E240D4004; Wed, 21 Dec 2022 18:51:58 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 mail.ispras.ru 168E240D4004 Date: Wed, 21 Dec 2022 21:51:58 +0300 (MSK) From: Alexander Monakov To: Alejandro Colomar cc: gcc@gcc.gnu.org, Andrew Clayton Subject: Re: -minstd: Require a minimum std version, without being specific In-Reply-To: Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Spam-Status: No, score=-3.1 required=5.0 tests=BAYES_00,KAM_DMARC_STATUS,SPF_HELO_NONE,SPF_PASS,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 Wed, 21 Dec 2022, Alejandro Colomar via Gcc wrote: > Hi, > > I've long had this wish: an option similar to -std, but which would not > specify the standard. Rather, mark a requirement that the standard be at > least a version. > > This would be especially useful for libraries, which might for example require > C99 or C11 to work. They would be able to specify -minstd=c11 in their pc(5) > file (for use with pkgconf(1)). There's already a standard, portable way to check: #if __STDC_VERSION__ < 201710 #error C17 required #endif Alexander