stdint.h question

Ralf Corsepius ralf.corsepius at rtems.org
Thu May 3 06:42:15 UTC 2007


On Wed, 2007-05-02 at 20:14 -0700, Till Straumann wrote:
> Who has not encountered those (and other annoying)
> warnings:
> 
>  > warning: format '%x' expects type 'unsigned int', but argument 6 has 
> type 'uint32_t'
> 
> e.g., under linux (glibc) I don't get those but when porting code
> to RTEMS I do. linux' stdint.h defines uint32_t as 'unsigned int'
> (on a 32-bit machine) but RTEMS/newlib as 'unsigned long'.
> (BTW: freebsd also uses int / unsigned int for int32_t / uint32_t
> [i386, powerpc]).
All random accidents. All such code doesn't comply to the standards.

> Does anybody have an idea how to properly deal with this?
Use the macros from inttypes.h.

Ralf





More information about the users mailing list