[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#367633: [Patch] Fix build Error math-tests



Package:glibc
Version:2.3.6-7
Serverity:wishlist
Tags:patch

Could you please apply the following patch?
This patch is to fix build Error in math-tests.

Regards,

Kazuhiro Inaoka
2006-05-17  Kazuhiro Inaoka  <inaoka.kazuhiro@renesas.com>

	* math/bug-nextafter.c (main): Add check FE_OVERFLOW.
	* math/bug-nexttoward.c (main): Ditto.
	* math/libm-test.inc (rint_test_tonearest): Add check FE_TONEAREST.
	(rint_test_towardzero): Add check FE_TOWARDZERO
	(rint_test_downward): Add check FE_DOWNWARD
	(rint_test_upward): Add check FE_UPWARD

Index: math/bug-nextafter.c
===================================================================
RCS file: /cvs/glibc/libc/math/bug-nextafter.c,v
retrieving revision 1.3
diff -u -p -r1.3 bug-nextafter.c
--- math/bug-nextafter.c	9 Dec 2003 18:10:47 -0000	1.3
+++ math/bug-nextafter.c	17 May 2006 09:58:40 -0000
@@ -9,6 +9,7 @@ main (void)
 {
   int result = 0;
 
+#ifdef FE_OVERFLOW
   float i = INFINITY;
   float m = FLT_MAX;
   feclearexcept (FE_ALL_EXCEPT);
@@ -58,6 +59,7 @@ main (void)
       puts ("nextafter- did not overflow");
       ++result;
     }
+#endif
 
   return result;
 }
Index: math/bug-nexttoward.c
===================================================================
RCS file: /cvs/glibc/libc/math/bug-nexttoward.c,v
retrieving revision 1.1
diff -u -p -r1.1 bug-nexttoward.c
--- math/bug-nexttoward.c	7 Dec 2003 21:13:09 -0000	1.1
+++ math/bug-nexttoward.c	17 May 2006 09:58:40 -0000
@@ -9,6 +9,7 @@ main (void)
 {
   int result = 0;
 
+#ifdef FE_OVERFLOW
   long double tl = (long double) FLT_MAX + 0x1.0p128L;
   float fi = INFINITY;
   float m = FLT_MAX;
@@ -60,6 +61,7 @@ main (void)
       puts ("nexttoward- did not overflow");
       ++result;
     }
+#endif
 
   return result;
 }
Index: math/libm-test.inc
===================================================================
RCS file: /cvs/glibc/libc/math/libm-test.inc,v
retrieving revision 1.64.2.1
diff -u -p -r1.64.2.1 libm-test.inc
--- math/libm-test.inc	16 Feb 2005 10:07:17 -0000	1.64.2.1
+++ math/libm-test.inc	17 May 2006 09:58:41 -0000
@@ -3800,6 +3800,7 @@ rint_test_tonearest (void)
   int save_round_mode;
   START (rint_tonearest);
 
+#ifdef FE_TONEAREST
   save_round_mode = fegetround();
 
   if (!fesetround (FE_TONEAREST))
@@ -3817,6 +3818,7 @@ rint_test_tonearest (void)
   }
 
   fesetround(save_round_mode);
+#endif
 
   END (rint_tonearest);
 }
@@ -3827,6 +3829,7 @@ rint_test_towardzero (void)
   int save_round_mode;
   START (rint_towardzero);
 
+#ifdef FE_TOWARDZERO
   save_round_mode = fegetround();
 
   if (!fesetround (FE_TOWARDZERO))
@@ -3844,6 +3847,7 @@ rint_test_towardzero (void)
   }
 
   fesetround(save_round_mode);
+#endif
 
   END (rint_towardzero);
 }
@@ -3854,6 +3858,7 @@ rint_test_downward (void)
   int save_round_mode;
   START (rint_downward);
 
+#ifdef FE_DOWNWARD
   save_round_mode = fegetround();
 
   if (!fesetround (FE_DOWNWARD))
@@ -3871,6 +3876,7 @@ rint_test_downward (void)
   }
 
   fesetround(save_round_mode);
+#endif
 
   END (rint_downward);
 }
@@ -3881,6 +3887,7 @@ rint_test_upward (void)
   int save_round_mode;
   START (rint_upward);
 
+#ifdef FE_UPWARD
   save_round_mode = fegetround();
 
   if (!fesetround (FE_UPWARD))
@@ -3898,6 +3905,7 @@ rint_test_upward (void)
   }
 
   fesetround(save_round_mode);
+#endif
 
   END (rint_upward);
 }

Reply to: