Date: Tue, 8 Sep 1998 21:43:52 +0200 (MET DST) From: Elliott Oti To: Eli Zaretskii cc: Elliott Oti , djgpp AT delorie DOT com Subject: Re: XWinAllegro In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Precedence: bulk On Tue, 8 Sep 1998, Eli Zaretskii wrote: > > On Tue, 8 Sep 1998, Elliott Oti wrote: > > > allegro.h: In function `movedatal': > > allegro.h:234: warning: cast to pointer from integer of different size > > > > -- I let these ride. > > Beware: Alpha's long is 64-bit wide whereas a pointer is 32 bits (or is it > the other way around?), so the compiler tells you here that you are > casting 64 bits to 32 bits, which is not a very good idea... > > Many programs which assume that pointers and longs are the same size > break on Alpha (the core dump at run time). > The program int main() { printf("\n%d %d %d", sizeof(int), sizeof(long), sizeof(void *)); } has as output 4 8 8 Thus ints are 32-bit, longs and pointers are 64-bit. So casting the ints to pointers was OK, but saving the contents of a pointer in an int and reusing it later will cause a core dump. Hmmm. Didn't know that. Cheers, Elliott Oti http://www.fys.ruu.nl/~oti "Q: What did the elephant say to the naked man? A: It's cute but can you pick up peanuts with it?"