viele C libs können mit den stdint Datentypen int8_t oder uint8_t nichts anfangen, selbst wenn stdint #included ist, sie ewarten die "genuinen" Typen char oder int, je nachdem, was halt in den libs steht und verwednet wird.
Selbst unsigned char oder signed char sind auf Lib- und Compilerebene nicht von vornherein mit char kompatibel, sie sind "etwas anderes".
cstring arbeitet ausschließlich mit char, mit nichts anderem.
Wenn ein cstring benutzt wird, muss also ein array of char übergeben werdem.
Haben die eigenen Daten eine andere Struktur, musst du sie vorher oder hinterher entsprechend explizit casten, was oft sehr umständlich ist, besser also, man verwendet von vornherein das, was die Lib erwartet.
https://www.raspberrypi.org/forums/v...d0047#p1429279char is signed on Intel (edit: and AVR) and unsigned on ARM (the Pi
(edit: ) and ARM Cortex M0 + M3 + M4 e.g., Zero +Due, and ESP)).
You cannot explicitly use "signed char" or "unsigned char" which, though legal types, are both distinct from the "char" type that library functions expect.
The only option if the type of char is important (which it often is) is to use the "-funsigned-char" compiler option. All C compilers have similar options.
"uint8_t" etc will fail when library functions are used.
Das gilt also entsprechend verschärft für int8_t oder uint8_t und erst recht für selber definierte ganz "neue" Datentypen wie das "uChr " bei dir.
Lesezeichen