public inbox for newlib@sourceware.org
 help / color / mirror / Atom feed
From: Keith Packard <keithp@keithp.com>
To: newlib@sourceware.org
Subject: [PATCH 0/2] Floating point conversion warning fixes [v2]
Date: Thu, 20 Aug 2020 17:35:37 -0700	[thread overview]
Message-ID: <20200821003539.942952-1-keithp@keithp.com> (raw)

Thanks much to both Joseph Myers and C Howland for explaining how the
constants in math.h should be defined and encouraging me to figure out
why clang's builtin classification macros weren't being used.

This series removes all of those changes to math.h and enables the
clang builtins for isinf and friends.

My goal is to be able to compile the math code with -Wdouble-promotion
-Werror=double-promotion which will flag any un-intended use of the
default float promotion rules as an error. This will ensure that
systems with only float acceleration will not accidentally use soft
double code.

This patch only addresses a handful of actual bugs of this form; most
of the changes are to mark places where promotion was intended.

Here are the files with bugs that this patch addresses:

	newlib/libm/common/sf_logb.c
	newlib/libm/complex/cephes_subrf.c
	newlib/libm/math/wf_scalb.c

The rest of the changes serve to quiet the compiler so that those bugs
could be found, and so that future bugs will be caught.



             reply	other threads:[~2020-08-21  0:35 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-21  0:35 Keith Packard [this message]
2020-08-21  0:35 ` [PATCH 1/2] Avoid implicit floating point conversions [v2] Keith Packard
2020-08-24  9:58   ` Corinna Vinschen
2020-08-24 15:33     ` Keith Packard
2020-08-25 11:10       ` Corinna Vinschen
2020-08-25 13:37       ` Thomas Wucher
2020-08-21  0:35 ` [PATCH 2/2] libm/common: Remove unused 'dec' function from sqrtl.c Keith Packard

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200821003539.942952-1-keithp@keithp.com \
    --to=keithp@keithp.com \
    --cc=newlib@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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 read-only IMAP folder(s) and NNTP newsgroup(s).