avr-gcc-list
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [avr-gcc-list] integer overflow


From: eric
Subject: Re: [avr-gcc-list] integer overflow
Date: Tue, 27 May 2003 23:40:13 GMT

> Eric,
> 
> > Yeah? You're only half right.
> > 
> > If you read Ömer's post, val is an unsigned long.
> > 
> > So you need to do:
> > 
> > val = 1000UL*60*60*24;
> > 
> > to make it an unsigned long constant to match the type 
of
> > the variable.
> > 
> > Eric
> 
> Hmmm...my copy of "avr-gcc" (version 2.95.2) didn't seem 
to care.
> 
> But you are right, an expression such as...
> 
>    val = 3000L*1000*1000;
> 
> ....does give a warning because the result exceeds 
2147483647.
> 
> Best regards,
> 
> Bruce
> 

See this: <http://www.gnu.org/software/gcc/gcc-3.3/>

Eric





reply via email to

[Prev in Thread] Current Thread [Next in Thread]