[Gmp-commit] /var/hg/gmp: Remove 2 clang warnings in the testsuite (printf ar...

mercurial at gmplib.org mercurial at gmplib.org
Sat Sep 21 11:39:48 CEST 2013


details:   /var/hg/gmp/rev/c22ca3db7d7d
changeset: 16012:c22ca3db7d7d
user:      Marc Glisse <marc.glisse at inria.fr>
date:      Sat Sep 21 11:39:43 2013 +0200
description:
Remove 2 clang warnings in the testsuite (printf argument type mismatch and signed overflow).

diffstat:

 ChangeLog            |  5 +++++
 tests/mpn/t-mulmid.c |  2 +-
 tests/rand/t-urbui.c |  2 +-
 3 files changed, 7 insertions(+), 2 deletions(-)

diffs (36 lines):

diff -r 003df884d053 -r c22ca3db7d7d ChangeLog
--- a/ChangeLog	Sat Sep 21 01:48:10 2013 +0200
+++ b/ChangeLog	Sat Sep 21 11:39:43 2013 +0200
@@ -1,3 +1,8 @@
+2013-09-21  Marc Glisse  <marc.glisse at inria.fr>
+
+	* tests/mpn/t-mulmid.c: Cast arguments of printf to int to match %d.
+	* tests/rand/t-urbui.c: Use 1UL for unsigned constant.
+
 2013-09-20  Torbjorn Granlund  <tege at gmplib.org>
 
 	* mpn/x86_64/coreisbr/redc_1.asm: New file.
diff -r 003df884d053 -r c22ca3db7d7d tests/mpn/t-mulmid.c
--- a/tests/mpn/t-mulmid.c	Sat Sep 21 01:48:10 2013 +0200
+++ b/tests/mpn/t-mulmid.c	Sat Sep 21 11:39:43 2013 +0200
@@ -78,7 +78,7 @@
       if (mpn_cmp (refp, rp, rn))
 	{
 	  printf ("ERROR in test %d, an = %d, bn = %d, rn = %d\n",
-		  test, an, bn, rn);
+		  test, (int) an, (int) bn, (int) rn);
 	  printf("a: "); mpn_dump (ap, an);
 	  printf("b: "); mpn_dump (bp, bn);
 	  printf("r:   "); mpn_dump (rp, rn);
diff -r 003df884d053 -r c22ca3db7d7d tests/rand/t-urbui.c
--- a/tests/rand/t-urbui.c	Sat Sep 21 01:48:10 2013 +0200
+++ b/tests/rand/t-urbui.c	Sat Sep 21 11:39:43 2013 +0200
@@ -35,7 +35,7 @@
   for (bits = 0; bits < BITS_PER_ULONG; bits++)
     {
       /* will demand got < limit */
-      limit = (1L << bits);
+      limit = (1UL << bits);
 
       for (i = 0; i < 5; i++)
         {


More information about the gmp-commit mailing list