OSDN Git Service

Fix strict-aliasing issues with _strtod_r and Storeinc.
authorhp <hp>
Wed, 25 Jun 2008 01:45:01 +0000 (01:45 +0000)
committerhp <hp>
Wed, 25 Jun 2008 01:45:01 +0000 (01:45 +0000)
commit7f6cd52240eed4b4eddca041e03bb958518de220
tree4ac443dc7729a81c8a65d03dd442ddd29d33b154
parentde3cb3f7fd27619a9bbad85f03cfa435dd205782
Fix strict-aliasing issues with _strtod_r and Storeinc.
* libc/stdlib/strtod.c (_strtod_r): Change local variables aadj,
rv, rv0 from double to type U.  Use accessor macros dval, dword0
and dword1 for all accesses except for the ULtod call, where rv.i
replaces the pointer cast.
* libc/stdlib/mprec.h (U): Rename member L to i for easier re-use
of access macros.  Tweak comment.
Remove #ifdef'd YES_ALIAS code.
(dword0, dword1, dval): Define in terms of uncast union member
access.  Ditto for _DOUBLE_IS_32BITS variants.
(Storeinc): Replace aliasing-flawed microoptimized definition with
alternative suggested in comment.  Remove now stale comment.
newlib/ChangeLog
newlib/libc/stdlib/mprec.h
newlib/libc/stdlib/strtod.c