"Paul McClean" <p.mccl...@kelvatek.com> wrote:

> I recently discovered that the int32_t and uint32_t typedefs in stdint.h
> are incorrect (at least on my target - AT90CAN128).

j@uriah 173% cat > sizeof.c
#include <stdint.h>

unsigned int sizeof_uint32_t(void)
{
  return sizeof(uint32_t);
}

unsigned int sizeof_int32_t(void)
{
  return sizeof(int32_t);
}
^D
j@uriah 174% avr-gcc -mmcu=at90can128 -Os -S sizeof.c
j@uriah 175% cat sizeof.s
        .file   "sizeof.c"
....
sizeof_uint32_t:
/* prologue: function */
/* frame size = 0 */
/* stack size = 0 */
..L__stack_usage = 0
        ldi r24,lo8(4)
        ldi r25,hi8(4)
/* epilogue start */
        ret
        .size   sizeof_uint32_t, .-sizeof_uint32_t
..global sizeof_int32_t
        .type   sizeof_int32_t, @function
sizeof_int32_t:
/* prologue: function */
/* frame size = 0 */
/* stack size = 0 */
..L__stack_usage = 0
        ldi r24,lo8(4)
        ldi r25,hi8(4)
/* epilogue start */
        ret
        .size   sizeof_int32_t, .-sizeof_int32_t

-- 
cheers, J"org               .-.-.   --... ...--   -.. .  DL8DTL

http://www.sax.de/~joerg/                        NIC: JW11-RIPE
Never trust an operating system you don't have sources for. ;-)

_______________________________________________
AVR-GCC-list mailing list
AVR-GCC-list@nongnu.org
https://lists.nongnu.org/mailman/listinfo/avr-gcc-list

Reply via email to