[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: [avr-gcc-list] Int32 Support
From: |
Nigel Winterbottom |
Subject: |
RE: [avr-gcc-list] Int32 Support |
Date: |
Mon, 18 Sep 2006 22:35:58 +0100 |
> -----Original Message-----
> From: User Tomdean
> Sent: Monday, September 18, 2006 9:52 PM
> To: address@hidden
> Subject: Re: [avr-gcc-list] Int32 Support
>
> Something I forget: C is a glorified assembly language!
>
> # cat xx.c
> #include <stdio.h>
> int main() {
> uint8_t z = sizeof(uint32_t);
> uint32_t a = 0x00000001<<14;
> uint32_t b = 0x00000001<<15;
> uint32_t c = 0x00000001<<16; /* produces a warning - see below */
> return -1;
> }
You forget the standard 'c' gotcha:
external void fn(uint32_t, uint32_t);
int main() {
uint32_t a = 0x10000000<<15; /* produces no warning */
uint32_t b = 0x1111000000000000;
fn(a,b); //Use the variables
return -1;
}
No warning is given but the variable a is set to zero.
However, more worrying is that variable b is also zero. (Looks like the 0x
parser only does 16-bits)
Nigel