I'm afraid I already know the answer to this question, but I would like to be sure ...
I have a fairly large project with a header file, which typedefs native types:
typedef unsigned long int u32; typedef signed long int s32;
Inevitably happened, and now I'm trying to compile a system where long is 64 bits instead of 32. What is the best way to do this?
I could have typedef above with int (or int32_t / uint32_t from stdint.h) that would suit the 32bit size on platforms that I know of, but that still seems dubious. There is also a problem with printf style functions that used %ld (the compiler complains and would like to see %d ). They all need to be changed, right (perhaps with the definitions in inttypes.h)?
It seems simple, but I would like to be sure before I start digging into it (correcting printf format strings seems intimidating).
josec source share