[PATCH 0/2] Floating point conversion warning fixes [v2]
Keith Packard via Newlib <[email protected]>
| Newsgroups | gmane.comp.lib.newlib |
|---|---|
| Message-ID | <[email protected]> |
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.