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: Sander Pool
Subject: Re: [avr-gcc-list] integer overflow
Date: Tue, 27 May 2003 13:01:20 -0700

I recommend you use the types defined in <inttypes.h> instead.

You could use uint32_t for example.

    Sander

----- Original Message -----
From: "Ömer Sinan KAYA" <address@hidden>
To: <address@hidden>
Sent: Tuesday, May 27, 2003 12:52 PM
Subject: [avr-gcc-list] integer overflow


> hi ,
> i have an overflow warning from the compiler
> here is the code that makes the problem
> unsigned long val;
>
> val = 1000*60*60*24;
>
> i think the problem stems from the sizeof long , as far as i know long
> is 4 bytes for atmel processors and integer is 2 bytes.the maximum
> value for 4 bytes is
>
> FFFFFFFF which is 4,294,967,295 that is bigger than 86,400,000.
>
> if long is 2 bytes than is there a built in structure for carrying 4
> bytes ?
>
> thanks,
>
> --------------------------------------------------------------
> Ömer Sinan KAYA
> address@hidden
> http://skaya.cjb.net
> +90 262 648 13 97 / +90 262 648 16 91
>
> SeMA Working Group
> Computer address@hidden University,Istanbul,Turkey
> http://ics.yeditepe.edu.tr/tnl
>
> Turkish National Research Institute Of Science And Technology
> address@hidden
> --------------------------------------------------------------
>
>
> _______________________________________________
> avr-gcc-list mailing list
> address@hidden
> http://www.avr1.org/mailman/listinfo/avr-gcc-list
>



reply via email to

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