XC32 1.44 added Newlib as an option
Yeah, I saw that in the release notes. I also saw
This option is primarily intended for applications being ported to XC32 from other compilers that use the Newlib Standard C Library.
So I didn't bother. Heck, unless there is a real advantage (a really, really real advantage) to any kind of new stuff, I would happily (or, at least less unhappily) settle for an update that didn't break stuff that I was already using.
Anyhow, just for kicks, after seeing your post, since the project was still fresh in my mind, I started it up again and added -mnewlib-libc
to the XC32 global options for my little test program. This test does a little more, but not much more, than the floating point stuff I reported. Using newlib resulted in the same (acceptable) "%g" output as the non-legacy-libc.
For this test I am using XC32 version 1.44 in "Free" mode with optimization level 1.
Result: Without legacy-libc and without newlib:
Program size = 19548 bytes (30% of my MM0064GPL028)
Program size = 55424 bytes (85% of my MM0064GPL028)
This isn't necessarily a show stopper (my "real" project with this chip doesn't use floating point calculations or printing, and I didn't test it without the floating point stuff), but it gives me pause (and makes me fraught).
Bottom line regarding the "%g" format specifier:
The non-legacy-libc, non-newlib library acts the same as gcc version 4.4.7 on my workstation. As reported by the OP, the legacy-libc does not. The newlib might have some advantages that I haven't observed, but then I haven't looked very hard.
(Ars longa, vita brevis.)
post edited by davekw7x - 2017/10/10 17:37:22