summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--acinclude.m46
-rw-r--r--configure.ac2
-rw-r--r--tests/trint.c8
3 files changed, 9 insertions, 7 deletions
diff --git a/acinclude.m4 b/acinclude.m4
index f17018e54..5cc1df4c6 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -919,11 +919,13 @@ else
/* "before" is 16 bytes to ensure there's no padding between it and "x".
We're not expecting any "long double" bigger than 16 bytes or with
alignment requirements stricter than 16 bytes. */
-struct {
+typedef struct {
char before[16];
long double x;
char after[8];
-} foo = {
+} foo_t;
+
+foo_t foo = {
{ '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
'\001', '\043', '\105', '\147', '\211', '\253', '\315', '\357' },
-123456789.0,
diff --git a/configure.ac b/configure.ac
index 661e0c876..2f8ae8fd3 100644
--- a/configure.ac
+++ b/configure.ac
@@ -447,7 +447,7 @@ error
#endif
]], [[]])],[
AC_MSG_RESULT(no)
- CFLAGS="-Wmissing-prototypes $CFLAGS"
+ CFLAGS="-Wmissing-prototypes -Wc++-compat $CFLAGS"
],[
AC_MSG_RESULT(yes)
CFLAGS="-Wmissing-declarations -Wno-sign-compare $CFLAGS"
diff --git a/tests/trint.c b/tests/trint.c
index fbf599b1c..fd2a45ca2 100644
--- a/tests/trint.c
+++ b/tests/trint.c
@@ -337,12 +337,12 @@ test_fct (double (*f)(double), int (*g)(), char *s, mpfr_rnd_t r)
mpfr_clear (yy);
}
-#define TEST_FCT(F) test_fct (&F, &mpfr_##F, #F, r)
+#define TEST_FCT(F) test_fct (&F, &mpfr_##F, #F, (mpfr_rnd_t) r)
static void
test_against_libc (void)
{
- mpfr_rnd_t r = MPFR_RNDN;
+ int r = MPFR_RNDN;
(void) r; /* avoid a warning by using r */
#if HAVE_ROUND
@@ -359,8 +359,8 @@ test_against_libc (void)
#endif
#if HAVE_NEARBYINT
for (r = 0; r < MPFR_RND_MAX ; r++)
- if (mpfr_set_machine_rnd_mode (r) == 0)
- test_fct (&nearbyint, &mpfr_rint, "rint", r);
+ if (mpfr_set_machine_rnd_mode ((mpfr_rnd_t) r) == 0)
+ test_fct (&nearbyint, &mpfr_rint, "rint", (mpfr_rnd_t) r);
#endif
}