From: Paul Eggert Date: Fri, 18 Dec 2015 07:06:29 +0000 (-0800) Subject: intprops: comment fix X-Git-Tag: v1.0~6881 X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=a214964682085cb1e57a77db082f5e9387646f9c;p=gnulib.git 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 --- diff --git a/ChangeLog b/ChangeLog index 4fb4b97db8..3945c58d20 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 8fff86d437..ecafaf70e1 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: