diff options
author | Marc Glisse <marc.glisse@inria.fr> | 2016-08-22 23:15:56 +0200 |
---|---|---|
committer | Marc Glisse <marc.glisse@inria.fr> | 2016-08-22 23:15:56 +0200 |
commit | 889915a509fc49acf7cfc37d674f1b43436981ab (patch) | |
tree | 2df479d0756b7332eb788093812c68fecae8c4a6 | |
parent | 2df52ea31ca8722b3ab371eb40450cb2e40f65e5 (diff) | |
download | gmp-889915a509fc49acf7cfc37d674f1b43436981ab.tar.gz |
Protect umul_ppmm with do ... while (0) as recommended by Vincent Lefevre.
-rw-r--r-- | ChangeLog | 9 | ||||
-rw-r--r-- | longlong.h | 4 |
2 files changed, 9 insertions, 4 deletions
@@ -1,3 +1,8 @@ +2016-08-22 Marc Glisse <marc.glisse@inria.fr> + + * longlong.h (umul_ppmm from __umulsidi3): Protect with do ... + while (0). + 2016-08-22 Niels Möller <nisse@lysator.liu.se> * mini-gmp/mini-gmp.c (mpn_set_str_other): Always return size >= @@ -8,7 +13,7 @@ failure for inputs string with no digits, i.e., empty except for optional sign, base prefix and white space. -2015-04-07 Marc Glisse <marc.glisse@inria.fr> +2016-04-07 Marc Glisse <marc.glisse@inria.fr> * gmp-h.in (__GMP_NOTHROW): Prefer noexcept to throw(). (mpz_init, mpz_inits): Mark as __GMP_NOTHROW. @@ -49,7 +54,7 @@ * configure.ac: Support many arm64 processors. -2015-03-20 Marc Glisse <marc.glisse@inria.fr> +2016-03-20 Marc Glisse <marc.glisse@inria.fr> * configure.ac (WANT_ASSEMBLY): Remove. (NO_ASM): Remove from CFLAGS, add to AC_DEFINE. diff --git a/longlong.h b/longlong.h index fde527703..6dedc1360 100644 --- a/longlong.h +++ b/longlong.h @@ -1895,11 +1895,11 @@ extern UWtype __MPN(udiv_qrnnd) (UWtype *, UWtype, UWtype, UWtype); /* FIXME: "sidi" here is highly doubtful, should sometimes be "diti". */ #if !defined (umul_ppmm) && defined (__umulsidi3) #define umul_ppmm(ph, pl, m0, m1) \ - { \ + do { \ UDWtype __ll = __umulsidi3 (m0, m1); \ ph = (UWtype) (__ll >> W_TYPE_SIZE); \ pl = (UWtype) __ll; \ - } + } while (0) #endif #if !defined (__umulsidi3) |