]> Savannah Git Hosting - gnulib.git/commitdiff
verify: document ‘assume’ better
authorPaul Eggert <eggert@cs.ucla.edu>
Tue, 2 Jul 2019 23:33:04 +0000 (16:33 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Tue, 2 Jul 2019 23:33:31 +0000 (16:33 -0700)
* lib/verify.h: Reword doc (Bug#36370).

ChangeLog
lib/verify.h

index 77d8e9e6a00e231fa961c8d543532a7a34e6ada6..b89fd5d9e5e9ddd667a4b9590533e768eebaff10 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2019-07-02  Paul Eggert  <eggert@cs.ucla.edu>
+
+       verify: document ‘assume’ better
+       * lib/verify.h: Reword doc (Bug#36370).
+
 2019-07-02  Bruno Haible  <bruno@clisp.org>
 
        localcharset, nl_langinfo: Fix return value for UTF-8 locales on MSVC.
index f8e4eff026dd20aeed48c620c1cfec2f7087e26f..9b8e1ed20fa10276f15234a17f6e70fe896730cc 100644 (file)
@@ -259,9 +259,11 @@ template <int w>
 # define __has_builtin(x) 0
 #endif
 
-/* Assume that R always holds.  This lets the compiler optimize
-   accordingly.  R should not have side-effects; it may or may not be
-   evaluated.  Behavior is undefined if R is false.  */
+/* Assume that R always holds.  Behavior is undefined if R is false,
+   fails to evaluate, or has side effects.  Although assuming R can
+   help a compiler generate better code or diagnostics, performance
+   can suffer if R uses hard-to-optimize features such as function
+   calls not inlined by the compiler.  */
 
 #if (__has_builtin (__builtin_unreachable) \
      || 4 < __GNUC__ + (5 <= __GNUC_MINOR__))