[0/2] Floating point conversion warning fixes [v2]

Message ID 20200821003539.942952-1-keithp@keithp.com
Headers show
  • Floating point conversion warning fixes [v2]
Related show


Torbjorn SVENSSON via Newlib Aug. 21, 2020, 12:35 a.m.
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:


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.