unlike suggested in the comments to the question, sint32
is not uncommon in safety critical and embedded systems and usually falls back to a typecast for int
. (e.g. in some MISRA environments).
Hence
sint32 a = -1;
printf("%d", a);
should do the trick anyways. tested with gcc v5.2.1 and arm-gcc v5.2.1 (-Wall and no warnings).
If it still gives you a warning try to figure out what sint32
really maps to and try long
-print: printf("%ld")
. However, then double check if the byte length of sint32
really is 32bits? (and some systems may even have less than a 32bit architecture)
1
solved How to printf a sint32 in C using gcc compiler tricore v3.4.6?