Re: -minstd: Require a minimum std version, without being specific

2022-12-21 Thread Ben Boeckel via Gcc
On Wed, Dec 21, 2022 at 19:33:48 +0100, Alejandro Colomar via Gcc wrote: > 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,

Re: -minstd: Require a minimum std version, without being specific

2022-12-21 Thread Alejandro Colomar via Gcc
Hi Alexander, On 12/21/22 20:12, Alexander Monakov wrote: On Wed, 21 Dec 2022, Alejandro Colomar via Gcc wrote: There's already a standard, portable way to check: #if __STDC_VERSION__ < 201710 #error C17 required #endif Hmm, not my favourite to stick that in every public header file, but y

Re: -minstd: Require a minimum std version, without being specific

2022-12-21 Thread Jonathan Wakely via Gcc
On Wed, 21 Dec 2022, 19:08 Alejandro Colomar via Gcc, wrote: > > > On 12/21/22 19:53, Alejandro Colomar wrote: > > Hi Alexander, > > > > On 12/21/22 19:51, Alexander Monakov wrote: > >> > >> > >> On Wed, 21 Dec 2022, Alejandro Colomar via Gcc wrote: > >> > >>> Hi, > >>> > >>> I've long had this w

Re: -minstd: Require a minimum std version, without being specific

2022-12-21 Thread Alexander Monakov via Gcc
On Wed, 21 Dec 2022, Alejandro Colomar via Gcc wrote: > > There's already a standard, portable way to check: > > > > #if __STDC_VERSION__ < 201710 > > #error C17 required > > #endif > > Hmm, not my favourite to stick that in every public header file, but yes, it's > portable. I don't see why

Re: -minstd: Require a minimum std version, without being specific

2022-12-21 Thread Alejandro Colomar via Gcc
On 12/21/22 19:53, Alejandro Colomar wrote: Hi Alexander, On 12/21/22 19:51, Alexander Monakov wrote: 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 t

Re: -minstd: Require a minimum std version, without being specific

2022-12-21 Thread Alejandro Colomar via Gcc
Hi Alexander, On 12/21/22 19:51, Alexander Monakov wrote: 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

Re: -minstd: Require a minimum std version, without being specific

2022-12-21 Thread Alexander Monakov via Gcc
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

-minstd: Require a minimum std version, without being specific

2022-12-21 Thread Alejandro Colomar via Gcc
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 spec