VS: Support new separated C and C++ language standard options for VS 16.8+
Visual Studio 16.8 will support separated language standard options for C and C++.
See release note for 16.8 preview 3 at https://docs.microsoft.com/en-us/visualstudio/releases/2019/release-notes-preview#16.8.0-pre-3.0
C11 and C17 are now supported under the /std:c11 and /std:c17 switches.
There is repro.gif for 16.8 preview 3 at https://developercommunity.visualstudio.com/content/problem/1186075/ignore-languagestandard-for-c-source-when-using-cl.html
If I guessed (I only have 16.7.3 installed, not tried the preview release) correctly, they are CLanguageStandard
and CppLanguageStandard
, as seen from
<Path to Visual Studio 2019>\MSBuild\Microsoft\VC\v160\Microsoft.Cpp.Clang.targets
<ClCompile>
<!-- Dont pass C standard to C++ and vice versa -->
<CLanguageStandard Condition="'%(ClCompile.CompileAs)' == 'CompileAsCpp'"></CLanguageStandard>
<CppLanguageStandard Condition="'%(ClCompile.CompileAs)' == 'CompileAsC'"></CppLanguageStandard>
<!-- C doesn't support 'RuntimeTypeInfo' -->
<RuntimeTypeInfo Condition="'%(ClCompile.CompileAs)' == 'CompileAsC'" />
</ClCompile>
Edited by Brad King