This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: casting on 64/32-bit environment


Mitja Ursic writes:

 > Compiling of a cc program with g++ on 64-bit environment gives me a warning of 
 > a type ?Warning: cast from pointer to integer of different size? on a place 
 > were casting really takes place. If I compile the same program on 32-bit 
 > environment I don?t have warning anymore.
 > Dose anyone have a reasonable explanation about that?

The problem here is that we don't know what you don't understand.

If you're casting a pointer to an (32-bit) int, then if you are on a
64-bit system, there will be overflow and some information will be
lost.  If you're on a 32-bit system then there won't be a problem.
This seems obvious: what's the problem?

Andrew.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]