summaryrefslogtreecommitdiffstats
path: root/Modules/CheckCCompilerFlag.cmake
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2010-12-16 18:34:54 (GMT)
committerBrad King <brad.king@kitware.com>2010-12-16 18:34:54 (GMT)
commitb3efdb58d5436276b65f1dad396265a6cc742910 (patch)
tree318bdadef0dd4a239c04779febf661ebd7b26660 /Modules/CheckCCompilerFlag.cmake
parentaadee46c60953f7e3d3715bb8847dfa6b8bf64fb (diff)
downloadCMake-b3efdb58d5436276b65f1dad396265a6cc742910.zip
CMake-b3efdb58d5436276b65f1dad396265a6cc742910.tar.gz
CMake-b3efdb58d5436276b65f1dad396265a6cc742910.tar.bz2
CheckCCompilerFlag: Strict signature of 'main' (#11615)
Use "int main(void)" instead of just "int main()" so that compiling with "gcc -Werror=strict-prototypes" works. Test this check using the flags "-Werror -Wstrict-prototypes" to work with old GCC versions.
Diffstat (limited to 'Modules/CheckCCompilerFlag.cmake')
-rw-r--r--Modules/CheckCCompilerFlag.cmake2
1 files changed, 1 insertions, 1 deletions
diff --git a/Modules/CheckCCompilerFlag.cmake b/Modules/CheckCCompilerFlag.cmake
index cf519b1..a03b64d 100644
--- a/Modules/CheckCCompilerFlag.cmake
+++ b/Modules/CheckCCompilerFlag.cmake
@@ -25,7 +25,7 @@ INCLUDE(CheckCSourceCompiles)
MACRO (CHECK_C_COMPILER_FLAG _FLAG _RESULT)
SET(SAFE_CMAKE_REQUIRED_DEFINITIONS "${CMAKE_REQUIRED_DEFINITIONS}")
SET(CMAKE_REQUIRED_DEFINITIONS "${_FLAG}")
- CHECK_C_SOURCE_COMPILES("int main() { return 0;}" ${_RESULT}
+ CHECK_C_SOURCE_COMPILES("int main(void) { return 0; }" ${_RESULT}
# Some compilers do not fail with a bad flag
FAIL_REGEX "unrecognized .*option" # GNU
FAIL_REGEX "ignoring unknown option" # MSVC