STM32CubeIDE sizeof return value and format PRIu32
Dear
Please connect me to someone who can help resolve issue with format specifiers mentioned in inttypes.h
I am building code for STM32H7xx microcontroller.
Concern 1:
Is it possible to update inttypes.h, as I believe PRIu32 should:
#define PRIu32 "u"
and not what is being defined/declared in inttypes.h file.
I believe the return type for sizeof() (used by STM32CubeIDE) is unsigned int, but the STM32CubeIDE is reporting warning (when I am trying to find the size of RECTANGLE array:
warning: format '%lu' expects argument of type 'long unsigned int', but argument 3 has type 'unsigned int' [-Wformat=]
39 | sprintf(tmpstr, "sizeof(RECTANGLE) %" PRIu32 "\n", sizeof(RECTANGLE));
| ^~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~
| |
| unsigned int
Concern 2:
"display" is an array that exists in external RAM
warning: format '%u' expects argument of type 'unsigned int', but argument 3 has type 'DISPLAY *' [-Wformat=]
45 | sprintf(tmpstr, "addr(display) %" PRIuPTR "\n", &display);
| ^~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~
| |
| DISPLAY *
Also,
warning: format '%p' expects argument of type 'void *', but argument 3 has type 'DISPLAY *' [-Wformat=]
45 | sprintf(tmpstr, "addr(display) %p\n", &display);
| ~^ ~~~~~~~~
| | |
| | DISPLAY *
| void *
Concern 3:
For 32 bit microcontroller, if possible please define uint32_t as "unsigned int" and NOT as "unsigned long"
