Re: Common Porting Problem

Bryan W. Headley (bheadley@interaccess.com)
Thu, 28 Nov 1996 22:08:18 -0600

On Nov 28, 2:38pm, Scott Locklin wrote:
> Subject: Common Porting Problem
> I know I'm going to be raked over the coals for asking this, as it's
> probably been rehashed any number of times; here it goes anyway.
>
> Lots of people write code which assumes the same number of bytes in
> pointers & integers; when I try to compile such code it complains
> something like
> "warning: cast to pointer from integer of different size"
> And when I try to run , it dumps core, like it's supposed to.
>
> My question; is there a compiler switch I can use to make the pointers 4
> bytes or the integers 8, so this stuff will work without major surgery?
> Or am I doomed to wading through dozens of
> "warning: cast to pointer from integer of different size"
> messages?
>
That's right: you are doomed. Nice thing is, there are more and more 64-bit
machines out there, so code is becoming more clean.

Or you can typedef those ints into longs :-) Sort of like a C++ mantra my
friend has on his board:

typedef class struct;
typedef protected public;
typedef private public;

-- 
Bryan W. Headley                    Home:   bheadley@interaccess.com
211 East Pineview Drive             Office: bwh@abnamro.com
Round Lake Park, IL 60073           Phone:  847 740-1446

--
To unsubscribe: send e-mail to axp-list-request@redhat.com with
'unsubscribe' as the subject.  Do not send it to axp-list@redhat.com



Feedback | Store | News | Support | Product Errata | About Us | Linux Info | Search | JumpWords
No Frames | Show Frames

Copyright © 1995-1997 Red Hat Software. Legal notices