View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0015906CMakeCMakepublic2016-01-09 12:372016-06-10 14:31
ReporterJan Henke 
Assigned ToKitware Robot 
PlatformOSWindowsOS Version10
Product VersionCMake 3.4.1 
Target VersionFixed in Version 
Summary0015906: With Microsoft Visual Studio CMake should use the C++ compiler for C files, if C standard >= C99 is set
DescriptionThe Mircosoft Visual Studio C compiler only supports ISO 9899:1989 (aka C89). Newer C features are only implemented in the C++ compiler and only for the subset of C, which is part of the C++ standard (see for reference: [^])

Since a few versions CMake provides a way to specify the features or standard for your application. Thus if the requested standard level is C99 or above, or any of the features introduced in C99 or above, CMake should use the C++ compiler for C files. To quote from above web site:

"We recommend that C developers use the C++ compiler to compile C code (using /TP if the file is named something.c). This is the best choice for using Visual C++ to compile C code."

Please change the generator for Visual Studio solutions accordingly. That way we can use modern C feature with CMake and the Visual Studio compilers.
TagsNo tags attached.
Attached Files


Kitware Robot (administrator)
2016-06-10 14:29

Resolving issue as `moved`.

This issue tracker is no longer used. Further discussion of this issue may take place in the current CMake Issues page linked in the banner at the top of this page.

 Issue History
Date Modified Username Field Change
2016-01-09 12:37 Jan Henke New Issue
2016-06-10 14:29 Kitware Robot Note Added: 0042909
2016-06-10 14:29 Kitware Robot Status new => resolved
2016-06-10 14:29 Kitware Robot Resolution open => moved
2016-06-10 14:29 Kitware Robot Assigned To => Kitware Robot
2016-06-10 14:31 Kitware Robot Status resolved => closed

Copyright © 2000 - 2018 MantisBT Team