diff options
author | Chris Metcalf <cmetcalf@ezchip.com> | 2014-12-30 14:11:13 -0500 |
---|---|---|
committer | Chris Metcalf <cmetcalf@ezchip.com> | 2014-12-30 14:11:13 -0500 |
commit | 1ff950ad20111b591ad1312df4d802de9d1f1b1e (patch) | |
tree | 6634ad2285443326d46d32a27f5d0d568ea5452e /math | |
parent | 0f9dfe0432a90441be688f2776aa19fedbfcdcbb (diff) | |
download | glibc-1ff950ad20111b591ad1312df4d802de9d1f1b1e.zip glibc-1ff950ad20111b591ad1312df4d802de9d1f1b1e.tar.gz glibc-1ff950ad20111b591ad1312df4d802de9d1f1b1e.tar.bz2 |
Fix some warnings in the absence of FP round/exception support
Due to tile missing a bunch of FP exception and rounding
support, the tests generate warnings. These changes fix the
warnings by just not compiling some unused functions, and
adding some attribute ((unused)) tags.
Diffstat (limited to 'math')
-rw-r--r-- | math/libm-test.inc | 7 | ||||
-rw-r--r-- | math/test-fenv.c | 14 |
2 files changed, 14 insertions, 7 deletions
diff --git a/math/libm-test.inc b/math/libm-test.inc index f86a4fa..b44b2db 100644 --- a/math/libm-test.inc +++ b/math/libm-test.inc @@ -590,6 +590,7 @@ print_complex_max_error (const char *func_name) } +#if FE_ALL_EXCEPT /* Test whether a given exception was raised. */ static void test_single_exception (const char *test_name, @@ -598,7 +599,7 @@ test_single_exception (const char *test_name, int fe_flag, const char *flag_name) { -#ifndef TEST_INLINE +# ifndef TEST_INLINE int ok = 1; if (exception & exc_flag) { @@ -634,9 +635,9 @@ test_single_exception (const char *test_name, if (!ok) ++noErrors; -#endif +# endif } - +#endif /* Test whether exceptions given by EXCEPTION are raised. Ignore thereby allowed but not required exceptions. diff --git a/math/test-fenv.c b/math/test-fenv.c index 23e47d4..0783fb1 100644 --- a/math/test-fenv.c +++ b/math/test-fenv.c @@ -54,6 +54,7 @@ static int count_errors; +#if FE_ALL_EXCEPT /* Test whether a given exception was raised. */ static void test_single_exception (short int exception, @@ -84,6 +85,7 @@ test_single_exception (short int exception, } } } +#endif static void test_exceptions (const char *test_name, short int exception, @@ -164,6 +166,7 @@ test_rounding (const char *test_name, int rounding_mode) } +#if FE_ALL_EXCEPT static void set_single_exc (const char *test_name, int fe_exc, fexcept_t exception) { @@ -195,6 +198,7 @@ set_single_exc (const char *test_name, int fe_exc, fexcept_t exception) feclearexcept (exception); test_exceptions (str, ALL_EXC ^ fe_exc, 0); } +#endif static void fe_tests (void) @@ -227,11 +231,12 @@ fe_tests (void) #endif } +#if FE_ALL_EXCEPT /* Test that program aborts with no masked interrupts */ static void feenv_nomask_test (const char *flag_name, int fe_exc) { -#if defined FE_NOMASK_ENV +# if defined FE_NOMASK_ENV int status; pid_t pid; @@ -247,13 +252,13 @@ feenv_nomask_test (const char *flag_name, int fe_exc) pid = fork (); if (pid == 0) { -#ifdef RLIMIT_CORE +# ifdef RLIMIT_CORE /* Try to avoid dumping core. */ struct rlimit core_limit; core_limit.rlim_cur = 0; core_limit.rlim_max = 0; setrlimit (RLIMIT_CORE, &core_limit); -#endif +# endif fesetenv (FE_NOMASK_ENV); feraiseexcept (fe_exc); @@ -284,7 +289,7 @@ feenv_nomask_test (const char *flag_name, int fe_exc) ++count_errors; } } -#endif +# endif } /* Test that program doesn't abort with default environment */ @@ -613,6 +618,7 @@ fe_single_test (const char *flag_name, int fe_exc) feenv_mask_test (flag_name, fe_exc); feenable_test (flag_name, fe_exc); } +#endif static void |