Pragmatically, if there is something to check endianness, make a working
chance for all targets, or at least non-breaking for little-endian
systems. I see not much value in finding by whom or why this
little-endian-only solution was written, because for me it is a clear error.

The implementation-defined part of the standard targets more prefix,
number of digits, number base, or other specialties like
"segment:offset", in my eyes. Swapping bytes does not belong here…

-Bodo

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?

I ask because I encounter once again today an annoyance I've encountered
before when working on big-endian target platforms such as the STM8.
Whenever you use %p, the pointer value is formatted with the bytes in
the wrong order. For example, a pointer with value of 0x87A1 is output
as "0xa187". It's annoying to have to mentally transpose the bytes when
looking at debugging output.

Regards,
Basil Hussain


_______________________________________________
Sdcc-user mailing list
Sdcc-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sdcc-user


_______________________________________________
Sdcc-user mailing list
Sdcc-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sdcc-user

Reply via email to