>From a214964682085cb1e57a77db082f5e9387646f9c Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Thu, 17 Dec 2015 23:06:29 -0800 Subject: [PATCH] intprops: comment fix MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * lib/intprops.h: Fix comment. Reported by Pádraig Brady in: http://lists.gnu.org/archive/html/bug-gnulib/2015-12/msg00013.html --- ChangeLog | 4 ++++ lib/intprops.h | 7 ++++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 4fb4b97..3945c58 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2015-12-17 Paul Eggert + intprops: comment fix + * lib/intprops.h: Fix comment. Reported by Pádraig Brady in: + http://lists.gnu.org/archive/html/bug-gnulib/2015-12/msg00013.html + intprops-test: work around GCC bug 68971 Problem reported by Pádraig Brady in: http://lists.gnu.org/archive/html/bug-gnulib/2015-12/msg00011.html diff --git a/lib/intprops.h b/lib/intprops.h index 8fff86d..ecafaf7 100644 --- a/lib/intprops.h +++ b/lib/intprops.h @@ -272,9 +272,10 @@ Example usage, assuming A and B are long int: - long int result = INT_MULTIPLY_WRAPV (a, b); - printf ("result is %ld (%s)\n", result, - INT_MULTIPLY_OVERFLOW (a, b) ? "after overflow" : "no overflow"); + if (INT_MULTIPLY_OVERFLOW (a, b)) + printf ("result would overflow\n"); + else + printf ("result is %ld (no overflow)\n", a * b); Example usage with WRAPV flavor: -- 2.5.0