Search code examples
c++cvisual-c++terminologystandards-compliance

Microsoft C/C++: what is the definition of "strict conformance" w.r.t. implementation?


Context:

/Za, /Ze (Disable Language Extensions):

... the C compiler conforms strictly to the C89/C90 standard

/permissive- (Standards conformance):

... and sets the /Zc compiler options for strict conformance

C++ Conformance improvements, behavior changes, and bug fixes in Visual Studio 2019:

... /permissive may be specified to turn off strict conformance mode in the compiler.

The second option is meant to disable the strict conformance mode ...

clock:

Note that this is not strictly conformant with ISO C99 ...

Walkthrough: Compile a C program on the command line:

MSVC is compatible with the ANSI C89 and ISO C99 standards, but not strictly conforming.

Question: what is the definition of "strict conformance"? Was it invented by Microsoft?

Note: both C (n2596.pdf) and C++ (n4849.pdf) standards no not use term "strict conformance" / "strictly conforming" applied to the implementation. The implementation is either conforming, either non-conforming. W/o gradations.

UPD. My guess: under "strict conformance" (w.r.t. to implemtation) Microsoft means "conforming implementation w/o support of any extensions".


Solution

  • The C11 standard defines a strictly conforming program and implementation in section 4 paragraphs 5-7 as follows:

    5 A strictly conforming program shall use only those features of the language and library specified in this International Standard. It shall not produce output dependent on any unspecified, undefined, or implementation-defined behavior, and shall not exceed any minimum implementation limit.

    6 The two forms of conforming implementation are hosted and freestanding. A conforming hosted implementation shall accept any strictly conforming program. A conforming freestanding implementation shall accept any strictly conforming program in which the ∗ use of the features specified in the library clause (clause 7) is confined to the contents of the standard headers <float.h>, <iso646.h>, <limits.h>, <stdalign.h>, <stdarg.h>, <stdbool.h>, <stddef.h>, <stdint.h>, and <stdnoreturn.h>. A conforming implementation may have extensions (including additional library functions), provided they do not alter the behavior of any strictly conforming program.

    7 A conforming program is one that is acceptable to a conforming implementation.

    While the terms strictly conforming implementation and strict conformance do not appear here, they can be understood to mean an implementation (in a given mode) that will only accept a strictly conforming program (or more accurately, an implementation that doesn't support features not specified in the standard) .