#include <stdlib.h>
#include <stdio.h>
#define SIZE_TYPE
#define MEM_SIZE_BYTES 4096
#define MEM_SIZE_WORDS MEM_SIZE_BYTES/sizeof(int)
int main() {
printf("bytes are %d\n", MEM_SIZE_BYTES);
printf("words are %d\n", MEM_SIZE_WORDS);
}
Compilation gives a warning...why?
testintsize.c:11:5: warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘long unsigned int’ [-Wformat]
I found out SIZE_TYPE macro here: https://gcc.gnu.org/onlinedocs/gccint/Type-Layout.html Is that related to this.
Doing this did not cause the warning to go away:
#define SIZE_TYPE int