Feature request: treat double as float
Bug #1732683 reported by
john
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
GNU Arm Embedded Toolchain |
New
|
Undecided
|
Unassigned |
Bug Description
Omitting double precision floating point code when it's not really needed could save precious memory on small targets. Unfortunately, double precision code gets pulled in when using sprintf. Besides, float is automatically converted to double when passed to sprintf, so execution speed suffers as well.
A compiler option to treat double as float would solve this. Besides, the standard library compiled with this option would have to be shipped.
To post a comment you must log in.
Developing such a feature would take a big effort and a long time. As you said the compiler needs to be changed and so does the C library. All the ramifications need to be considered. One needs to consider how many people would benefit. Newlib-nano already has a mechanism to have floating point support in printf and scanf optional which provides better reward (more code saved) for less work (change in compiler is only a nice to have to automate the selection of float code).
All in all, I don't believe we can justify working on this for the time being.
Best regards.