[cmake-developers] [CMake 0012633]: GCC fails some flags with "is valid for C++/ObjC++ but not for C"

Mantis Bug Tracker mantis at public.kitware.com
Sun Dec 18 14:11:30 EST 2011


The following issue has been SUBMITTED. 
====================================================================== 
http://public.kitware.com/Bug/view.php?id=12633 
====================================================================== 
Reported By:                hrogge
Assigned To:                
====================================================================== 
Project:                    CMake
Issue ID:                   12633
Category:                   CMake
Reproducibility:            always
Severity:                   major
Priority:                   normal
Status:                     new
====================================================================== 
Date Submitted:             2011-12-18 14:11 EST
Last Modified:              2011-12-18 14:11 EST
====================================================================== 
Summary:                    GCC fails some flags with "is valid for C++/ObjC++
but not for C"
Description: 
GCC has some flags that are valid for C++, but not for C. The different warning
message breaks the CHECK_C_COMPILER_FLAG macro.

Suggestion: add
  'FAIL_REGEX "but not for C" # GNU'

to CheckCCompilerFlag.cmake

Steps to Reproduce: 
compile "int main(void) { return 0 };" on gcc 4.4.5 with -Wenum-compare:

/usr/bin/gcc -Wenum-compare -o test.o -c test.c 
cc1: warning: command line option "-Wenum-compare" is valid for C++/ObjC++ but
not for C


Additional Information: 
Combined with ADD_DEFINITIONS(-Werror) this can break the build process. The
CheckCCompilerFlag does not recognize that -Wenum-compare is not available,
-Werror stops the build process.

====================================================================== 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2011-12-18 14:11 hrogge         New Issue                                    
======================================================================




More information about the cmake-developers mailing list