The following issue has been SUBMITTED. 
====================================================================== 
https://public.kitware.com/Bug/view.php?id=15906 
====================================================================== 
Reported By:                Jan Henke
Assigned To:                
====================================================================== 
Project:                    CMake
Issue ID:                   15906
Category:                   CMake
Reproducibility:            always
Severity:                   major
Priority:                   normal
Status:                     new
====================================================================== 
Date Submitted:             2016-01-09 12:37 EST
Last Modified:              2016-01-09 12:37 EST
====================================================================== 
Summary:                    With Microsoft Visual Studio CMake should use the
C++ compiler for C files, if C standard >= C99 is set
Description: 
The 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:
http://herbsutter.com/2012/05/03/reader-qa-what-about-vc-and-c99/)

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.
====================================================================== 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2016-01-09 12:37 Jan Henke      New Issue                                    
======================================================================

-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake-developers

Reply via email to