MantisBT - CMake | ||||||||||
View Issue Details | ||||||||||
ID | Project | Category | View Status | Date Submitted | Last Update | |||||
0011753 | CMake | (No Category) | public | 2011-01-25 19:34 | 2016-06-10 14:31 | |||||
Reporter | James Bigler | |||||||||
Assigned To | James Bigler | |||||||||
Priority | normal | Severity | minor | Reproducibility | have not tried | |||||
Status | closed | Resolution | moved | |||||||
Platform | OS | OS Version | ||||||||
Product Version | ||||||||||
Target Version | Fixed in Version | |||||||||
Summary | 0011753: int main() can cause warnings when -Wstrict-prototypes and -Werror is used | |||||||||
Description | In 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. | |||||||||
Steps To Reproduce | ||||||||||
Additional Information | grep -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() { | |||||||||
Tags | No tags attached. | |||||||||
Relationships |
| |||||||||
Attached Files | main-void.patch (5,680) 2011-01-25 19:34 https://public.kitware.com/Bug/file/3656/main-void.patch | |||||||||
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 |
Notes | |||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|