From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/6404 Path: news.gmane.org!not-for-mail From: Rich Felker Newsgroups: gmane.linux.lib.musl.general Subject: Re: [PATCH] Error when built with -ffast-math. Date: Fri, 31 Oct 2014 14:16:02 -0400 Message-ID: <20141031181602.GE22465@brightrain.aerifal.cx> References: <1414778845-11512-1-git-send-email-ibid.ag@gmail.com> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1414779384 20319 80.91.229.3 (31 Oct 2014 18:16:24 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 31 Oct 2014 18:16:24 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-6417-gllmg-musl=m.gmane.org@lists.openwall.com Fri Oct 31 19:16:18 2014 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1XkGkD-00065Y-8g for gllmg-musl@m.gmane.org; Fri, 31 Oct 2014 19:16:17 +0100 Original-Received: (qmail 2016 invoked by uid 550); 31 Oct 2014 18:16:16 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Original-Received: (qmail 2008 invoked from network); 31 Oct 2014 18:16:15 -0000 Content-Disposition: inline In-Reply-To: <1414778845-11512-1-git-send-email-ibid.ag@gmail.com> User-Agent: Mutt/1.5.21 (2010-09-15) Original-Sender: Rich Felker Xref: news.gmane.org gmane.linux.lib.musl.general:6404 Archived-At: 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 > #include > > +#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