[Cmake-commits] CMake branch, next, updated. v2.8.3-942-gf00150f

Brad King brad.king at kitware.com
Thu Dec 16 13:36:44 EST 2010


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".

The branch, next has been updated
       via  f00150f718262fb6d0edf1a0e586ea23b6e053ab (commit)
       via  b3efdb58d5436276b65f1dad396265a6cc742910 (commit)
      from  2a9c28f059ce171a0b19a34edd72d816a330e826 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=f00150f718262fb6d0edf1a0e586ea23b6e053ab
commit f00150f718262fb6d0edf1a0e586ea23b6e053ab
Merge: 2a9c28f b3efdb5
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Thu Dec 16 13:36:41 2010 -0500
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Thu Dec 16 13:36:41 2010 -0500

    Merge topic 'CheckCCompilerFlag-strict-prototypes' into next
    
    b3efdb5 CheckCCompilerFlag: Strict signature of 'main' (#11615)


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=b3efdb58d5436276b65f1dad396265a6cc742910
commit b3efdb58d5436276b65f1dad396265a6cc742910
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Thu Dec 16 13:34:54 2010 -0500
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Thu Dec 16 13:34:54 2010 -0500

    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.

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
diff --git a/Tests/TryCompile/CMakeLists.txt b/Tests/TryCompile/CMakeLists.txt
index a57498f..90c2cfc 100644
--- a/Tests/TryCompile/CMakeLists.txt
+++ b/Tests/TryCompile/CMakeLists.txt
@@ -226,3 +226,9 @@ UNSET(CXX_BOGUS_FLAG CACHE)
 INCLUDE(CheckCXXCompilerFlag)
 CHECK_CXX_COMPILER_FLAG(${CXX_DD}-_this_is_not_a_flag_ CXX_BOGUS_FLAG)
 TEST_FAIL(CXX_BOGUS_FLAG "CHECK_CXX_COMPILER_FLAG() succeeded, but should have failed")
+
+IF("${CMAKE_C_COMPILER_ID}" STREQUAL "GNU")
+  UNSET(C_STRICT_PROTOTYPES CACHE)
+  CHECK_C_COMPILER_FLAG("-Werror;-Wstrict-prototypes" C_STRICT_PROTOTYPES)
+  TEST_ASSERT(C_STRICT_PROTOTYPES "CHECK_C_COMPILER_FLAG failed -Werror -Wstrict-prototypes")
+ENDIF()

-----------------------------------------------------------------------

Summary of changes:
 Modules/CheckCCompilerFlag.cmake |    2 +-
 Tests/TryCompile/CMakeLists.txt  |    6 ++++++
 2 files changed, 7 insertions(+), 1 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list