]> Savannah Git Hosting - gnulib.git/commitdiff
verify: port 'assume' to traditional tools
authorPaul Eggert <eggert@cs.ucla.edu>
Sun, 12 Aug 2018 01:56:40 +0000 (18:56 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Sun, 12 Aug 2018 01:57:36 +0000 (18:57 -0700)
* lib/verify.h (assume): Port better to Oracle Studio 12.6
and other tools that use /*NOTREACHED*/ comments.

ChangeLog
lib/verify.h

index 404af4f13e946fddab6e8793c0cd9f9812359811..6418dae91ebd314334d0b738347d34d04777c55e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2018-08-11  Paul Eggert  <eggert@cs.ucla.edu>
+
+       verify: port 'assume' to traditonal tools
+       * lib/verify.h (assume): Port better to Oracle Studio 12.6
+       and other tools that use /*NOTREACHED*/ comments.
+
 2018-08-10  Bruno Haible  <bruno@clisp.org>
 
        fnmatch: Fix compilation error in C++ namespace mode on Mac OS X.
index bc7f99dbd739a2ec6d4ecd85abf7af8eddf3fd92..3b57ddee0acffd23cc51bc8910a15cf879f90619 100644 (file)
@@ -276,7 +276,8 @@ template <int w>
      when 'assume' silences warnings even with older GCCs.  */
 # define assume(R) ((R) ? (void) 0 : __builtin_trap ())
 #else
-# define assume(R) ((void) (0 && (R)))
+  /* Some tools grok NOTREACHED, e.g., Oracle Studio 12.6.  */
+# define assume(R) ((R) ? (void) 0 : /*NOTREACHED*/ (void) 0)
 #endif
 
 /* @assert.h omit end@  */