[Cmake-commits] CMake branch, master, updated. v2.8.2-62-g70154ef

KWSys Robot kwrobot at kitware.com
Fri Jul 9 10:40:12 EDT 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, master has been updated
       via  70154efef86c7025435b15c52a8a1a5b47067835 (commit)
      from  a1a4a2cb6dbcc0b2ec0f07aa2d4b36242e4fe3df (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=70154efef86c7025435b15c52a8a1a5b47067835
commit 70154efef86c7025435b15c52a8a1a5b47067835
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Fri Jul 9 10:30:18 2010 -0400
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Fri Jul 9 10:40:06 2010 -0400

    KWSys: Avoid undefined behavior in Process crash tests
    
    Clang is smart enough to recognize that "*(int*)0=0" invokes undefined
    behavior, warns, and produces an "undefined instruction".  The message
    in commit "Avoid Clang optimizer bug in testProcess-[45]" (2010-07-02)
    is incorrect; this is not a Clang bug.  It really is undefined
    behavior.  Use "*(int*)1=0" to produce a crash instead.

diff --git a/Source/kwsys/testProcess.c b/Source/kwsys/testProcess.c
index 6044917..877002a 100644
--- a/Source/kwsys/testProcess.c
+++ b/Source/kwsys/testProcess.c
@@ -94,9 +94,8 @@ int test4(int argc, const char* argv[])
   fprintf(stderr, "Output before crash on stderr from crash test.\n");  
   fflush(stdout);
   fflush(stderr);
-#if defined(__APPLE__) && defined(__x86_64__) && defined(__OPTIMIZE__) \
- && defined(__clang__)
-  *(int*)1 = 0; /* Clang's optimizer produces bad code for 0-ptr.  */
+#if defined(__clang__)
+  *(int*)1 = 0; /* Clang warns about 0-ptr; undefined behavior.  */
 #else
   *(int*)0 = 0;
 #endif

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

Summary of changes:
 Source/kwsys/testProcess.c |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list