[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[avr-gcc-list] integer overflow
From: |
Ömer Sinan KAYA |
Subject: |
[avr-gcc-list] integer overflow |
Date: |
Tue, 27 May 2003 22:52:49 +0300 |
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] integer overflow,
Ömer Sinan KAYA <=