This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Fix math/tst-CMPLX.c


math/tst-CMPLX.c didn't actually build with GCC 4.7 (the version required 
for the built-ins needed for the CMPLX macros) because it used size_t 
without including any header defining that type (it also used printf 
without a header declaring it).  I've committed this obvious patch to 
include <stdio.h> in this test to fix both those issues; it now passes 
(though it doesn't test the more interesting aspects of the macros - that 
they get cases involving signed zeros, infinities and NaNs right, which 
was why the macros were added in C11 - if you wanted to test those, it 
would probably be appropriate to start with the test I wrote for GCC, 
gcc.dg/torture/builtin-complex-1.c, and adapt it to use the macros instead 
of using __builtin_complex directly).

diff --git a/ChangeLog b/ChangeLog
index 929500c..05bc67b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2012-02-03  Joseph Myers  <joseph@codesourcery.com>
+
+	* math/tst-CMPLX.c: Include <stdio.h>.
+
 2012-01-31  Joseph Myers  <joseph@codesourcery.com>
 
 	* sysdeps/powerpc/bits/mathdef.h (float_t): Always define as
diff --git a/math/tst-CMPLX.c b/math/tst-CMPLX.c
index 2c32438..5e9a501 100644
--- a/math/tst-CMPLX.c
+++ b/math/tst-CMPLX.c
@@ -1,4 +1,5 @@
 #include <complex.h>
+#include <stdio.h>
 
 
 static int

-- 
Joseph S. Myers
joseph@codesourcery.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]