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

Alejandro Colomar alx.manpages@gmail.com
Wed Dec 21 19:15:07 GMT 2022


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 yes, it's
>> portable.
> 
> I don't see why you'd need that in "every public header". Public headers
> should be so simple they would have no need to check C version at all, no?

For example, I'm currently writing a library that uses C99 inline.  Compiling 
with GNU C89 inline would probably be very bad; if it works, I wouldn't trust 
that code.  (okay, I know there's -fno-gnu89-inline; but I just want to be on 
the safe side, and disallow C89/GNUC89 entirely).

Cheers,

Alex

> 
> Alexander

-- 
<http://www.alejandro-colomar.es/>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_signature
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <https://gcc.gnu.org/pipermail/gcc/attachments/20221221/e97f810c/attachment.sig>


More information about the Gcc mailing list