Philipp Klaus Krause schreef op 2021-11-11 19:58:
Am 10.11.21 um 23:38 schrieb Basil Hussain:
Hi all,
Quick question: was the SDCC standard library printf() implementation
for the %p conversion specifier written only with little-endian
platforms (e.g. 8051) in mind?
Sorry, bu, you are unlikely to get an answear. I have been an SDCC
developer since 2008. Maarten and Eric were there a bit earlier, but
not
much earlier. AFAIK, there are no developers left from before that
time.
The printf code is older. And when I joined, SDCC already had ports to
both little-endian and big-endian archiectures.
Philipp
P.S.: Though I think Maarten knows a bit about the printfc code, so
maybe he can reply, even though I think he, too wasn't there when it
was
written.
A long time ago I refactored vprint.c and printf_large.c, but the
little-endian assumption was there from the very start. But back then
mcs51 and ds390 were about the only targets.
I agree that %p should also print a normal readable pointer on a
big-endian target.
I think it would be wise to introduce a new predefined macro to indicate
the endianness.
Maarten
_______________________________________________
Sdcc-user mailing list
Sdcc-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sdcc-user