mailing list of musl libc
 help / color / mirror / code / Atom feed
* [PATCH] Error when built with -ffast-math.
@ 2014-10-31 18:07 Isaac Dunham
  2014-10-31 18:16 ` Rich Felker
  0 siblings, 1 reply; 2+ messages in thread
From: Isaac Dunham @ 2014-10-31 18:07 UTC (permalink / raw)
  To: musl; +Cc: Isaac Dunham

There was a bug report from someone who turned it on without knowing this.
---
 src/internal/libm.h | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/internal/libm.h b/src/internal/libm.h
index ebcd784..f8afe5d 100644
--- a/src/internal/libm.h
+++ b/src/internal/libm.h
@@ -19,6 +19,10 @@
 #include <complex.h>
 #include <endian.h>
 
+#ifdef __FAST_MATH__
+#error Using -ffast-math to compile libc will break
+#endif
+
 #if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024
 #elif LDBL_MANT_DIG == 64 && LDBL_MAX_EXP == 16384 && __BYTE_ORDER == __LITTLE_ENDIAN
 union ldshape {
-- 
2.1.2



^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] Error when built with -ffast-math.
  2014-10-31 18:07 [PATCH] Error when built with -ffast-math Isaac Dunham
@ 2014-10-31 18:16 ` Rich Felker
  0 siblings, 0 replies; 2+ messages in thread
From: Rich Felker @ 2014-10-31 18:16 UTC (permalink / raw)
  To: musl

On Fri, Oct 31, 2014 at 11:07:25AM -0700, Isaac Dunham wrote:
> There was a bug report from someone who turned it on without knowing this.
> ---
>  src/internal/libm.h | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/src/internal/libm.h b/src/internal/libm.h
> index ebcd784..f8afe5d 100644
> --- a/src/internal/libm.h
> +++ b/src/internal/libm.h
> @@ -19,6 +19,10 @@
>  #include <complex.h>
>  #include <endian.h>
>  
> +#ifdef __FAST_MATH__
> +#error Using -ffast-math to compile libc will break
> +#endif
> +

It may be desirable to catch broken build configurations (in fact
we're already doing it for wrong long double type), but if we want to
expand this perhaps it should be unified in one place rather than
spread out.

Also I'm not clear whether the problem is the -ffast-math option
itself. From what I can tell, it's just a meta option that turns on
other options, and turning on these options individually without using
-ffast-math would equally break things.

I'm not rejecting this but I think we should discuss it a bit first
and find the best way to catch problems like this if we're going to.

Rich


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-10-31 18:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-10-31 18:07 [PATCH] Error when built with -ffast-math Isaac Dunham
2014-10-31 18:16 ` Rich Felker

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).