This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
size mismatch with unsigned long long
- To: gcc at gcc dot gnu dot org
- Subject: size mismatch with unsigned long long
- From: Nitya Narasimhan <nitya at alpha dot ece dot ucsb dot edu>
- Date: Sun, 2 Jul 2000 13:10:59 -0700 (PDT)
- Reply-To: Nitya Narasimhan <nitya at alpha dot ece dot ucsb dot edu>
Hi,
I am using gcc version egcs-2.91.66 19990314 (egcs-1.1.2 release)
on a Sun UltraSPARC II (Solaris2.6)
I have a structure as follows
typedef struct connID{
unsigned long long ts;
int connNum;
}
This is part of a message header in a network application.
The problem is that I seem to have some size-mismatch due to the
use of the unsigned long long field.
Using both printf and gdb, I get the following
size of unsigned long long = 8
size of int = 4
size of connID = 16
Where are the extra 4 bytes coming from?
If I declare "ts" to be an int field, then the sizes are all
consistent. Its only the use of unsigned long long that causes
this problem. (I have #included sys/types.H to get the definition
of unsigned long long)
Can ANYONE shed some light on this .. unfortunately, this messes
up a lot of the other structures that rely on this struct so I
really need to fix this.
Thanks
-Nitya
_____________________________________________________________________
«¤»¥«¤»§«¤»¥«¤»§«¤»¥«¤»§«¤»¥«¤»§«¤»¥«¤»§«¤»¥«¤»§«¤»¥«¤»§«¤»¥«¤»§«¤»¥«
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
^ /) _/_ Nitya Narasimhan, Graduate Student Researcher
/ \ / . / _ _ Computer Networks & Distributed Systems Lab
(/ v _/_/_ /_/(_/_ University of California, Santa Barbara.
___/
( Email: nitya@alpha.ece.ucsb.edu
URL : http://alpha.ece.ucsb.edu/~nitya
_____________________________________________________________________
«¤»¥«¤»§«¤»¥«¤»§«¤»¥«¤»§«¤»¥«¤»§«¤»¥«¤»§«¤»¥«¤»§«¤»¥«¤»§«¤»¥«¤»§«¤»¥«
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯