[RFC/PATCH] Enable IEEE_Arith when double is 32 bits for strtod

Antony KING antony.king@st.com
Tue Aug 28 21:57:00 GMT 2007


Hi,

Attached is a 2 part patch I have constructed against 1.15.0 of newlib
in which part 1 fixes some compilation errors detected as a result of
defining "IEEE_Arith" in part 2 of the patch.

The second part of the patch fixes an error detected by Plumhall C test
suite (2007A) when running an application where doubles are 32 bits (in
this instance with the GCC SH4 ABI -m4-single-only). The test suite is
expecting that +/- HUGE_VAL is returned on overflow, which is the case
when a double is 64 bits but not when 32 bits. Part 2 of the patch
enables this behaviour. I also have attached a reduced form of the test
which illustrates the failure.

The ChangeLog entry:

        * libc/stdlib/mprec.h [_DOUBLE_IS_32BITS}: Define IEEE_Arith
	bits and redefine associated dword0 macro (rvalue issue).
	* libc/stdio/vfieeefp.h: Ditto.
        * libc/stdlib/strtod.c: Add checks for _DOUBLE_IS_32BITS
        to prevent setting dword1 which is an rvalue only.

Cheers,

Antony.

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: patch-INSbl27692-part2.txt
URL: <http://sourceware.org/pipermail/newlib/attachments/20070828/0ddc0c55/attachment.txt>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: patch-INSbl27692-part1.txt
URL: <http://sourceware.org/pipermail/newlib/attachments/20070828/0ddc0c55/attachment-0001.txt>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: INSbl27692.c
URL: <http://sourceware.org/pipermail/newlib/attachments/20070828/0ddc0c55/attachment.c>


More information about the Newlib mailing list