This is the mail archive of the newlib@sourceware.org mailing list for the newlib 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]

Re: SPU build break (Re: [PATCH v2] math: guard BSD finite/isinf/isnan functions properly in math.h)


On 2016-04-06 08:55, Ulrich Weigand wrote:
Yaakov Selkowitz wrote:

diff --git a/newlib/libc/include/ieeefp.h b/newlib/libc/include/ieeefp.h
index 2ffa456..2c04284 100644
--- a/newlib/libc/include/ieeefp.h
+++ b/newlib/libc/include/ieeefp.h
@@ -241,19 +241,6 @@ typedef int fp_rdi;
  fp_rdi _EXFUN(fpgetroundtoi,(void));
  fp_rdi _EXFUN(fpsetroundtoi,(fp_rdi));

-#undef isnan
-#undef isinf
-
-int _EXFUN(isnan, (double));
-int _EXFUN(isinf, (double));
-int _EXFUN(finite, (double));


It seems this caused a build break on SPU:

newlib/libm/common/s_isinf.c:17:9: error: expected identifier or '(' before 'sizeof'
  _DEFUN (isinf, (x),
          ^
newlib/libm/common/s_isinf.c:17:9: error: expected ')' before '?' token
  _DEFUN (isinf, (x),
          ^
because the SPU-specific #define of isinf from machine/ieeefp.h is still visible.

Since common/s_isinf.c includes <ieeefp.h>, it seems this wasn't a problem in
the past because of the above #undef that your patch removed.

Should the #undef now move somewhere else, e.g. into s_isinf.c (and presumably
s_isnan.c as well)?

Yes, those .c files would be the place for it; sf_isnan.c and sf_isinf.c already have such #undef's.

--
Yaakov Selkowitz
Associate Software Engineer, ARM
Red Hat, Inc.


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