c++ - 微软 C/C++ : what is the definition of "strict conformance" w. r.t.执行?

标签 c++ c visual-c++ terminology standards-compliance

语境:
/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.


问题:“严格一致性”的定义是什么?是微软发明的吗?
注意:C (n2596.pdf) 和 C++ (n4849.pdf) 标准都没有使用术语“严格符合”/“严格符合”应用于实现。实现要么符合,要么不符合。无渐变。
更新。我的猜测:在“严格一致性”(w.r.t. 到实现)下,微软的意思是“不支持任何扩展的一致性实现”。

最佳答案

您困惑的一个关键部分是 /Za和/Ze已被弃用且多年未更新。它是为 ANSI 98 引入的,此后一直没有改变。不要使用这些开关,并忽略文档中对它们的任何引用。
现代 Visual C++“一致性”开关是 /permissive-和各种 /Zc开关,结合 /std .
当前“最符合”的选项是:

  • C++20 是:/std:c++20
  • C++17 是:/std:c++17 /permissive- /Zc:preprocessor .
  • C++14 是:/std:c++14 /permissive- /Zc:preprocessor .
  • C11 是:/std:c11
  • C17 是:/std:c17

  • https://devblogs.microsoft.com/cppblog/msvc-cpp20-and-the-std-cpp20-switch/
    Visual C++ 一致性问题的一部分与预处理器有关
    https://devblogs.microsoft.com/cppblog/announcing-full-support-for-a-c-c-conformant-preprocessor-in-msvc/
    https://devblogs.microsoft.com/cppblog/c11-and-c17-standard-support-arriving-in-msvc/
    有关逐个功能的 segmentation ,请参阅 Microsoft Docs

    关于c++ - 微软 C/C++ : what is the definition of "strict conformance" w. r.t.执行?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/69575307/

    相关文章:

    c++ - 在二维数组的每一行中查找具有 1 个元素的所有可能组合

    c++ - 错误 : ‘IOV_MAX’ undeclared (first use in this function)

    c - 向所有客户端发送套接字 udp c

    c++ - 编译错误, header 上的重复成员,endian.h

    c++ - MSVS C++,如何编译扩展名为 *.i 的已预处理文件?

    c++ - LCS 的二维数组表

    c++ - 类外的成员模板函数定义无法构建 Visual Studio 2013

    c - C语言中关于scanf

    delphi - 需要将VC代码转换为Delphi

    visual-c++ - 奇怪的 VC10 链接器错误