Red Hat axp-list: Linux on Alpha (1995-2022)
 help / color / mirror / Atom feed
* pointer to integer of different size
@ 1998-01-27 15:05 Adrian Feiguin
  0 siblings, 0 replies; 2+ messages in thread
From: Adrian Feiguin @ 1998-01-27 15:05 UTC (permalink / raw)


When compiling many applications on my Alpha with RH4.2 and egcs-1.0.1, I
use to get the message:

warning: cast from pointer to integer of different size

Can anybody tell me why this happens, and if there is any flag to avoid
the consequent compilation errors?

TNX

<ADRIAN>

-- 
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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: pointer to integer of different size
@ 1998-01-27 15:44 David Alan Gilbert
  0 siblings, 0 replies; 2+ messages in thread
From: David Alan Gilbert @ 1998-01-27 15:44 UTC (permalink / raw)


Adrian Feiguin wrote:
> 
> When compiling many applications on my Alpha with RH4.2 and egcs-1.0.1, I
> use to get the message:
> 
> warning: cast from pointer to integer of different size
> 
> Can anybody tell me why this happens, and if there is any flag to avoid
> the consequent compilation errors?

On PC's and most other boxes integers are 4 bytes and pointers are 4 bytes.
Now your not supposed to store a pointer value in an integer but it
won't do any harm on a PC because they are the same size. It is however
grossly horrid in most cases.

On the Alpha, pointers are 8 bytes long so if you try and squeeze them
into a 4 byte integer you will loose something somewhere - and probably
crash natsily if you get the pointer back and try and use it somewhere

In general the error means that the code is broken and should be fixed.

Dave

-- 
----------------------------------------------------------------------
- Dr. David Alan Gilbert - WARNING! This is a beta release .signature-
- Work:    dg @ cogency.co.uk        -    0161-428-9444              -
- Home:    gro.gilbert @ treblig.org -                               -
----------------------------------------------------------------------

-- 
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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~1998-01-27 15:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1998-01-27 15:05 pointer to integer of different size Adrian Feiguin
  -- strict thread matches above, loose matches on Subject: below --
1998-01-27 15:44 David Alan Gilbert

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox