View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0012633CMakeCMakepublic2011-12-18 14:112012-09-03 16:01
Reporterhrogge 
Assigned ToBrad King 
PrioritynormalSeveritymajorReproducibilityalways
StatusclosedResolutionfixed 
PlatformOSOS Version
Product VersionCMake 2.8.6 
Target VersionCMake 2.8.8Fixed in VersionCMake 2.8.8 
Summary0012633: GCC fails some flags with "is valid for C++/ObjC++ but not for C"
DescriptionGCC 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 Reproducecompile "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 InformationCombined 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.
TagsNo tags attached.
Attached Files

 Relationships

  Notes
(0028009)
Brad King (manager)
2011-12-19 10:55

The regex added in

  http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=b7f3f7cd [^]

doesn't match?
(0028015)
Sean McBride (reporter)
2011-12-19 23:21

Not exactly related, but I'm very much reminded of bug 0004756.
(0028029)
hrogge (reporter)
2011-12-21 14:50

Ahh, I just noticed I was using 2.8.5 on one of the machines. The error does only happen in 2.8.6 when you use "-Werror" together with the other option, because the start of the output will change from "warning" to "error".

But testing two options at once was more an experiment to learn what was going on than a good usage.

Sorry for making that much noise.

Maybe it would be a good idea to completely remove the "warning:" part from the regex (and replace the "# Apple gcc" comment with "# gcc", because it can also happens on Linux).
(0028035)
Brad King (manager)
2011-12-22 09:42

Good ideas, thanks:

 http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=646cf919 [^]
(0030868)
David Cole (manager)
2012-09-03 16:01

Closing resolved issues that have not been updated in more than 4 months.

 Issue History
Date Modified Username Field Change
2011-12-18 14:11 hrogge New Issue
2011-12-19 10:55 Brad King Note Added: 0028009
2011-12-19 23:21 Sean McBride Note Added: 0028015
2011-12-21 14:50 hrogge Note Added: 0028029
2011-12-22 09:42 Brad King Note Added: 0028035
2011-12-22 09:42 Brad King Status new => resolved
2011-12-22 09:42 Brad King Resolution open => fixed
2011-12-22 09:42 Brad King Assigned To => Brad King
2012-04-19 15:42 David Cole Fixed in Version => CMake 2.8.8
2012-04-19 15:42 David Cole Target Version => CMake 2.8.8
2012-09-03 16:01 David Cole Note Added: 0030868
2012-09-03 16:01 David Cole Status resolved => closed


Copyright © 2000 - 2018 MantisBT Team