From: hoffman@xdelta.zko.dec.nospam (Hoff Hoffman)
Subject: Re: Linux and C pointers (was: Re: HELP with pointers into mem!!!!!!!
Date: 2000/05/02 [thread overview]
Message-ID: <8enkvs$iub$1@mailint03.im.hou.compaq.com> (raw)
In-Reply-To: 390F2291.26ECE26D@hotmail.com
In article <390F2291.26ECE26D@hotmail.com>, Antony Zyrmpas <z_antony@hotmail.com> writes:
: I am working on a Linux dec alpha using C and have a question. I am
:using integer pointers into memory, but int types are only 2-4 bytes
:long, while memory is addressed by 8 byte words. Is there any way to
:make C ints 8 bytes long or is there other solutions possible to this
:problem?
Which C compiler are you using, what version, and what are
the compile-time options you are using?
For 64 bits of addressing, you need eight bytes of storage.
Various data structures do not require quadword (8 bytes;
using the OpenVMS terminology) storage, and various compilers
thus use longword (4 bytes) for many integers.
At worst, you can stuff the pointer into 8 bytes of storage,
but there's very likely a better/prettier way to do this.
Depending on the C compiler, check around for the "long long"
or the "__int64" data types.
Also check the Linux sources, as casting pointers around has to
have come up somewhere during the development of the Alpha port.
I'd also tend to suggest asking this in a C or Linux newsgroup,
assuming that, say, the Gnu C documentation for Linux doesn't
have an answer for this particular question.
--------------------------- pure personal opinion ---------------------------
Hoff (Stephen) Hoffman OpenVMS Engineering hoffman#xdelta.zko.dec.com
prev parent reply other threads:[~2000-05-02 4:00 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2000-05-02 4:00 HELP with pointers into mem!!!!!!! Antony Zyrmpas
2000-05-02 4:00 ` Hoff Hoffman [this message]
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox