[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [avr-gcc-list] Int32 Support
From: |
Dave Hylands |
Subject: |
Re: [avr-gcc-list] Int32 Support |
Date: |
Mon, 18 Sep 2006 16:43:31 -0700 |
Hi Nigel,
Replying to list this time.
Hi Nigel,
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.
I get this when I try to compile it:
avr-gcc -c num.c
num.c: In function `main':
num.c:5: warning: integer constant is too large for "long" type
num.c:5: warning: large integer implicitly truncated to unsigned type
(that's with the 3.4.5 version of the compiler)
--
Dave Hylands
Vancouver, BC, Canada
http://www.DaveHylands.com/