Yesterday i picked up the "The C programming language" book from K&R and it states that a int is of the same of the platform default (and atleast 16bits) and a short int (or just short) is atmost 16 bits, and a long int (or just long) is at least always 32 bits. So the newlib definition of uint32_t and int32_t are correct by defining it as a long, however if you want to be picky :) you can hack your newlib includes to your favour. I've tested rebuilding the full compiler + sdk with the -Werror flag on and there are my only changes to make int32_t and uint32_t aliased to int and not long:
stdint.h
on line 37 i replaced the original preprocessor code with:
Code: Select all
/* Check if "long" is 64bit */
#if __STDINT_EXP(LONG_MAX) > 0x7fffffff
#define __have_long64 1
#endif
This removed the automatic __have_long32 definition to be defined thus later on int32_t will be mapped to int and not long
then on my SDK i configured it with:
CFLAGS=-Werror ./configure --with-pspdev=/c/pspsdk
and had only to fix the prof.c file because it warns about a missing and a wrong prototypes, so i replaced line 81 of prof.c with:
Code: Select all
void gprof_cleanup(void);
void __mcount(unsigned int, unsigned int);
and now the SDK builds without warning and errors and int32_t are int. I think that if you want to hack your current setup just edit the stdint.h on your psp/include dir like above and it works, BUT!!! from now on you may have broken the portability of your code...