Sujet : Re: Compile time checking of standards conformance
De : david.brown (at) *nospam* hesbynett.no (David Brown)
Groupes : comp.lang.c comp.lang.c++Date : 23. May 2024, 22:13:06
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <v2o80i$1tlge$2@dont-email.me>
References : 1 2 3 4 5
User-Agent : Mozilla Thunderbird
On 23/05/2024 17:14, olcott wrote:
On 5/23/2024 9:43 AM, David Brown wrote:
On 23/05/2024 16:18, olcott wrote:
On 5/23/2024 1:23 AM, Paavo Helde wrote:
On 23.05.2024 02:44, olcott wrote:
Does enables conformance mean: Flags non conformance?
>
No. Enabling conformance means enabling support for the conforming features.
>
Flagging non-conformance is not possible in general as there are more creative fools out there than there are compiler writers.
>
There are zillions of ways to write non-conforming code, for example an endless loop is not conforming in C++. The compiler is not obliged to diagnose it, but it is allowed for the compiler to silently optimize the non-conforming code away, assuming it is never called. At least that's what g++ folks think.
>
>
>
I would think that syntactically non-conforming code could be
flagged by the parser.
>
>
Syntax errors and many types of constraint violations will be flagged by the parser. But there are endless possibilities of non-conforming behaviour that cannot be seen at compile time.
>
Does enables conformance mean: Flags syntactic non conformance?
Not specifically, no. But enabling pedantic mode in gcc should give messages for all syntax errors and constraint violations for which diagnostics are required. I have no idea about MSVC and what it does there, but gcc considers any cases of missing required diagnostics (when in pedantic mode) to be a bug in the compiler.
/std:c11
The /std:c11 option enables ISO C11 conformance. It's available starting in Visual Studio 2019 version 16.8.
/std:c17
The /std:c17 option enables ISO C17 conformance. It's available starting in Visual Studio 2019 version 16.8.