summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorvlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4>2015-05-20 15:42:02 +0000
committervlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4>2015-05-20 15:42:02 +0000
commit92132f878010c7cc0552933fa1fab7b3bb779391 (patch)
treee8f0454e06e84c9e5b1cd5b4f744aea7257eb573
parentec667d25d1a861cc26de8e1fcf818dceab28b84b (diff)
downloadmpfr-92132f878010c7cc0552933fa1fab7b3bb779391.tar.gz
[tests/{tcmp_d.c,tcmp_ld.c,tget_d.c}] Avoid warnings concerning unused
variables when MPFR_ERRDIVZERO is defined (useful with -Werror). git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@9416 280ebfd0-de03-0410-8827-d642c229c3f4
-rw-r--r--tests/tcmp_d.c47
-rw-r--r--tests/tcmp_ld.c47
-rw-r--r--tests/tget_d.c4
3 files changed, 52 insertions, 46 deletions
diff --git a/tests/tcmp_d.c b/tests/tcmp_d.c
index 7e4346887..e35998d15 100644
--- a/tests/tcmp_d.c
+++ b/tests/tcmp_d.c
@@ -26,7 +26,6 @@ int
main (void)
{
mpfr_t x;
- int c;
tests_start_mpfr ();
@@ -67,31 +66,35 @@ main (void)
#if !defined(MPFR_ERRDIVZERO)
/* Check NAN */
- mpfr_clear_erangeflag ();
- c = mpfr_cmp_d (x, DBL_NAN);
- if (c != 0 || !mpfr_erangeflag_p ())
- {
- printf ("ERROR for NAN (1)\n");
+ {
+ int c;
+
+ mpfr_clear_erangeflag ();
+ c = mpfr_cmp_d (x, DBL_NAN);
+ if (c != 0 || !mpfr_erangeflag_p ())
+ {
+ printf ("ERROR for NAN (1)\n");
#ifdef MPFR_NANISNAN
- printf ("The reason is that NAN == NAN. Please look at the configure "
- "output\nand Section \"In case of problem\" of the INSTALL "
- "file.\n");
+ printf ("The reason is that NAN == NAN. Please look at the configure "
+ "output\nand Section \"In case of problem\" of the INSTALL "
+ "file.\n");
#endif
- exit (1);
- }
- mpfr_set_nan (x);
- mpfr_clear_erangeflag ();
- c = mpfr_cmp_d (x, 2.0);
- if (c != 0 || !mpfr_erangeflag_p ())
- {
- printf ("ERROR for NAN (2)\n");
+ exit (1);
+ }
+ mpfr_set_nan (x);
+ mpfr_clear_erangeflag ();
+ c = mpfr_cmp_d (x, 2.0);
+ if (c != 0 || !mpfr_erangeflag_p ())
+ {
+ printf ("ERROR for NAN (2)\n");
#ifdef MPFR_NANISNAN
- printf ("The reason is that NAN == NAN. Please look at the configure "
- "output\nand Section \"In case of problem\" of the INSTALL "
- "file.\n");
+ printf ("The reason is that NAN == NAN. Please look at the configure "
+ "output\nand Section \"In case of problem\" of the INSTALL "
+ "file.\n");
#endif
- exit (1);
- }
+ exit (1);
+ }
+ }
#endif /* MPFR_ERRDIVZERO */
mpfr_clear(x);
diff --git a/tests/tcmp_ld.c b/tests/tcmp_ld.c
index af3a6e365..16f9573f5 100644
--- a/tests/tcmp_ld.c
+++ b/tests/tcmp_ld.c
@@ -26,7 +26,6 @@ int
main (void)
{
mpfr_t x;
- int c;
tests_start_mpfr ();
@@ -67,31 +66,35 @@ main (void)
#if !defined(MPFR_ERRDIVZERO)
/* Check NAN */
- mpfr_clear_erangeflag ();
- c = mpfr_cmp_ld (x, DBL_NAN);
- if (c != 0 || !mpfr_erangeflag_p ())
- {
- printf ("ERROR for NAN (1)\n");
+ {
+ int c;
+
+ mpfr_clear_erangeflag ();
+ c = mpfr_cmp_ld (x, DBL_NAN);
+ if (c != 0 || !mpfr_erangeflag_p ())
+ {
+ printf ("ERROR for NAN (1)\n");
#ifdef MPFR_NANISNAN
- printf ("The reason is that NAN == NAN. Please look at the configure "
- "output\nand Section \"In case of problem\" of the INSTALL "
- "file.\n");
+ printf ("The reason is that NAN == NAN. Please look at the configure "
+ "output\nand Section \"In case of problem\" of the INSTALL "
+ "file.\n");
#endif
- exit (1);
- }
- mpfr_set_nan (x);
- mpfr_clear_erangeflag ();
- c = mpfr_cmp_ld (x, 2.0);
- if (c != 0 || !mpfr_erangeflag_p ())
- {
- printf ("ERROR for NAN (2)\n");
+ exit (1);
+ }
+ mpfr_set_nan (x);
+ mpfr_clear_erangeflag ();
+ c = mpfr_cmp_ld (x, 2.0);
+ if (c != 0 || !mpfr_erangeflag_p ())
+ {
+ printf ("ERROR for NAN (2)\n");
#ifdef MPFR_NANISNAN
- printf ("The reason is that NAN == NAN. Please look at the configure "
- "output\nand Section \"In case of problem\" of the INSTALL "
- "file.\n");
+ printf ("The reason is that NAN == NAN. Please look at the configure "
+ "output\nand Section \"In case of problem\" of the INSTALL "
+ "file.\n");
#endif
- exit (1);
- }
+ exit (1);
+ }
+ }
#endif /* MPFR_ERRDIVZERO */
mpfr_clear(x);
diff --git a/tests/tget_d.c b/tests/tget_d.c
index 9b5cf42b5..53097de4a 100644
--- a/tests/tget_d.c
+++ b/tests/tget_d.c
@@ -185,12 +185,12 @@ check_min(void)
static void
check_get_d_2exp_inf_nan (void)
{
+#if !defined(MPFR_ERRDIVZERO)
+
double var_d;
long exp;
mpfr_t var;
-#if !defined(MPFR_ERRDIVZERO)
-
mpfr_init2 (var, MPFR_PREC_MIN);
mpfr_set_nan (var);