Usenet comp.sys.dec (1990-2013)
 help / color / mirror / Atom feed
From: Larry Loen <lwloen@rchland.vnet.ibm.com>
To: Jeff Donsbach <jeff.donsbach@compaq.com>
Subject: Re: 32 and 64 bit questions
Date: 1999/11/11	[thread overview]
Message-ID: <382A737C.B9278BE2@rchland.vnet.ibm.com> (raw)
In-Reply-To: 809v3u$nfh$1@lead.zk3.dec.com



Jeff Donsbach wrote:

> Roberts answer is 100% correct. On Tru64 Unix, "long" is always 64 bit and
> "int" is always 32 bit using Compaq compilers. Other compilers such as gcc
> COULD use different rules, but I believe don't. That would be inconsistent
> with the system API's that expect "long" to be 64 bit values. Section 2.2 of
> the Tru64 Unix Programmer's Guide defines the sizes of all the base data
> types for Tru64 Unix. This applies to both C and C++. The FORTRAN compilers
> allow you to control the default size of the "INTEGER" data type via
> compiler switches. Seems pretty unambiguous to me.
>

Yes, I'm getting to understand this.  You have to realize, however,
that I had been going strictly by documentation I blundered into on-line
when I posted my original message.

I'm increasingly suspicious, thanks to responses like yours,
that the story is as I was originally told verbally:

  sizeof(int) is 4 bytes
  sizeof(long) is 8 bytes
  sizeof(void*) is usually 8 bytes.

is the correct one and that "usually" is true by default
(see below for a bit more).

>
> What is this "__32BITS" macro you are talking about? I've never seen it. Is
> it in some #include file you've found somewhere, perhaps the Rogue Wave
> include files that come with the C++ compiler? The Compaq compilers do not
> recognize any such #define that would alter the size of "long" data types.
> It is not possible to change the size of "long" data types with Compaq C or
> C++ compilers. I can't speak for other compilers.
>

In this aforementioned documentation I've blundered into, there seems to
be compile modes you can set that ask for a 32 bit data model.  When you set
that mode, the compiler sets a predefined variable __32BITS.  This must be
some kind of accommodation for old 32 bit apps or maybe it has
something to do with dealing with some old VAX support.  I have
no real idea.

So, if __32BITS is defined, it is a _compiler_ predefined macro based
on your asking for a 32 bit pointer/data model.

Both the older DEC C++ and newer COMPAQ C++ manuals I've
found on line seem to mention it.  It may be that Tru64 doesn't happen
to support this variation for all I know.


>
> By the way - in MS VC++ for Alpha, "void *" is also only 4 bytes, same as
> x86,  as Windows NT is a 32 bit operating system and all pointers are always
> 32 bits (leaving the Win64 SDK out of the picture for simplicity's sake).
>
> Is that any clearer now?
>
> Jeff D

Yes, this is all coming clear now.  Thanks.  Nothing like
a real domain expert to get answers.

I've also had some excellent help from
an individual via private e-mail.  I'd like
to acknowledge that person by name, but since that person
hasn't posted here, I'll merely state my thanks to a "knowledgable
source" until I get some kind of permission.  I forgot
to ask.





  reply	other threads:[~1999-11-11  5:00 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-11-04  5:00 32 and 64 bit questions Larry W Loen
1999-11-05  5:00 ` Robert Harley
1999-11-06  5:00   ` Larry Loen
1999-11-09  5:00     ` bdwheele
1999-11-09  5:00     ` Jeff Donsbach
1999-11-11  5:00       ` Larry Loen [this message]
1999-11-15  5:00 ` 32 and 64 bit questions (some results) Larry W Loen
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