wcstold implementation

Nicholas Clifton nickc@redhat.com
Fri Jan 23 16:01:00 GMT 2015


Hi Corinna,

> As an extension, for targets striving for smaller code size
> (PREFER_SIZE_OVER_SPEED or __OPTIMIZE_SIZE__), but double != long double,
> would it make sense to implement strtod in terms of strtold?

Hmm - are there any such targets ?

Anyway I think that in principle this might sound like a good idea, but 
in practice it probably will be bad.  The reason being that for targets 
where long double != double, and where code size matters, it is quite 
likely that double arithmetic is implemented in hardware (and hence does 
not take up a lot of room in applications) whereas long double support 
is almost certainly implemented in software and so it quite bulky.  Thus 
having a strtod() function which pulls in strtold() and the associate 
software long double support would be a bad thing, not a good thing.

Cheers
   Nick



More information about the Newlib mailing list