* lib/intprops.h: Fix comment. Reported by Pádraig Brady in:
http://lists.gnu.org/archive/html/bug-gnulib/2015-12/msg00013.html
2015-12-17 Paul Eggert <eggert@cs.ucla.edu>
+ 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
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: