From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 1164f8,76b62d6ecdceb3c4 X-Google-Attributes: gid1164f8,public From: Larry Loen Subject: Re: 32 and 64 bit questions Date: 1999/11/11 Message-ID: <382A737C.B9278BE2@rchland.vnet.ibm.com>#1/1 X-Deja-AN: 547238520 Content-Transfer-Encoding: 7bit References: <38220B81.B04EC3EE@rchland.vnet.ibm.com> <3824F582.855F31FA@rchland.vnet.ibm.com> <809v3u$nfh$1@lead.zk3.dec.com> To: Jeff Donsbach Content-Type: text/plain; charset=us-ascii X-Complaints-To: usenet@news.rchland.ibm.com X-Trace: news.rchland.ibm.com 942306174 33724 9.5.123.184 (11 Nov 1999 07:42:54 GMT) Organization: IBM Rochester MN Mime-Version: 1.0 Reply-To: lwloen, #, rchland.vnet.ibm.com NNTP-Posting-Date: 11 Nov 1999 07:42:54 GMT Newsgroups: comp.sys.dec 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.