View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0011753CMake(No Category)public2011-01-25 19:342016-06-10 14:31
ReporterJames Bigler 
Assigned ToJames Bigler 
PrioritynormalSeverityminorReproducibilityhave not tried
StatusclosedResolutionmoved 
PlatformOSOS Version
Product Version 
Target VersionFixed in Version 
Summary0011753: int main() can cause warnings when -Wstrict-prototypes and -Werror is used
DescriptionIn our projects we use -Wall -Wstrict-prototypes -Werror, and I just noticed that this causes all sorts of problems for the test code.

There seems like there are two solutions to this.

1. Fix all the test code, so that these warnings are tripped.
2. Somehow intercept try_compile so that it doesn't pass along things like -Werror.

I've attempted to implement #1 since it seems easier than modifying all the try_compile blocks with a compiler specific flag.

I've also attached a patch against my 2.8.3 installation.
Additional Informationgrep -nH -e "int main()" *

CheckCCompilerFlag.cmake:28: CHECK_C_SOURCE_COMPILES("int main() { return 0;}" ${_RESULT}
CheckCXXCompilerFlag.cmake:28: CHECK_CXX_SOURCE_COMPILES("int main() { return 0;}" ${_RESULT}
CheckForPthreads.c:9:int main(){
CheckFunctionExists.c:5:int main(){
CheckIncludeFile.c.in:4:int main()
CheckIncludeFile.cxx.in:3:int main()
CheckIncludeFiles.cmake:45: "${CMAKE_CONFIGURABLE_FILE_CONTENT}\n\nint main(){return 0;}\n")
CheckStructHasMember.cmake:41:int main()
CheckSymbolExists.cmake:50: "${CMAKE_CONFIGURABLE_FILE_CONTENT}\nvoid cmakeRequireSymbol(int dummy,...){(void)dummy;}\nint main()\n{\n#ifndef ${SYMBOL}\n cmakeRequireSymbol(0,&${SYMBOL});\n#endif\n return 0;\n}\n")
CheckVariableExists.c:6:int main(){
CMakeDetermineVSServicePack.cmake:64: "int main() { return 0; }\n")
CMakeTestCXXCompiler.cmake:28: "int main(){return 0;}\n")
CMakeTestForFreeVC.cxx:3:int main(){return 0;}
DummyCXXFile.cxx:1:int main()
FindOpenMP.cmake:57:int main() {
TagsNo tags attached.
Attached Filespatch file icon main-void.patch [^] (5,680 bytes) 2011-01-25 19:34 [Show Content]

 Relationships
related to 0011615closedBrad King CHECK_C_COMPILER_FLAG Problem, simple fix. 

  Notes
(0025079)
Brad King (manager)
2011-01-26 08:53

Fix from issue 0011615:

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=b3efdb58 [^]
(0025080)
Brad King (manager)
2011-01-26 08:54

This patch only affects the Modules/ directory.

As a module maintainer you should be able to commit your patch on top of 'master' and then merge to 'next' on the topic stage just as you do with FindCUDA changes.
(0041784)
Kitware Robot (administrator)
2016-06-10 14:28

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
2011-01-25 19:34 James Bigler New Issue
2011-01-25 19:34 James Bigler File Added: main-void.patch
2011-01-26 08:52 Brad King Relationship added related to 0011615
2011-01-26 08:53 Brad King Note Added: 0025079
2011-01-26 08:54 Brad King Assigned To => James Bigler
2011-01-26 08:54 Brad King Status new => assigned
2011-01-26 08:54 Brad King Note Added: 0025080
2016-06-10 14:28 Kitware Robot Note Added: 0041784
2016-06-10 14:28 Kitware Robot Status assigned => resolved
2016-06-10 14:28 Kitware Robot Resolution open => moved
2016-06-10 14:31 Kitware Robot Status resolved => closed


Copyright © 2000 - 2018 MantisBT Team