Red Hat axp-list: Linux on Alpha (1995-2022)
 help / color / mirror / Atom feed
* GCC 64 bit compliance
@ 1998-04-29 15:33 brinkmann
  1998-04-29 14:36 ` Stephen Williams
                   ` (4 more replies)
  0 siblings, 5 replies; 12+ messages in thread
From: brinkmann @ 1998-04-29 15:33 UTC (permalink / raw)
  To: axp-list

I have a question regarding GCC's compliance with the 64 bit Alpha
architecture.  This came up in conjunction with compiling XPostitPlus,
which casts pointers to int, always a bad idea.  I wrote a simple
program to check data type sizes.  As expected:

	char =		1 byte
	short int =	2 bytes
	int =		4 bytes
	long int =	8 bytes

	pointer =	8 bytes,

Checking further, I took a look in malloc.h, where size_t is defined,
on my Alpha and found

	#define size_t          unsigned int

shouldn't it be

	#define size_t          unsigned long int

on the Alpha???

I thought that the definition of "size_t" was supposed to be the same
size as a pointer (or memory address).  Otherwise, functions that
manipulate memory and/or return pointers, e.g., malloc, won't take
advantage of the available address space.

Jon
---
Dr. Jon Brinkmann				Apache Point Observatory
Instrument Scientist				2001 Apache Point Road
Internet:	brinkmann@nmsu.edu		P.O. Box 59
URL:	http://www.apo.nmsu.edu/brinkmann/	Sunspot, NM 88349-0059


^ permalink raw reply	[flat|nested] 12+ messages in thread
* RE: GCC 64 bit compliance
@ 1998-04-29 16:53 Alan Wood
  0 siblings, 0 replies; 12+ messages in thread
From: Alan Wood @ 1998-04-29 16:53 UTC (permalink / raw)
  To: axp-list@redhat.com


I know that it is not 32bit here after a few problems with dates after 
compiling Roxen. This is using RH4.2 & gcc 2.7.2.1 on a UDB

Alan

----------
From:  Richard Hadsell[SMTP:hadsell@blueskystudios.com]
Sent:  29 April 1998 17:28
To:  axp-list@redhat.com
Subject:  Re: GCC 64 bit compliance

brinkmann@nmsu.edu wrote:
> 
> Checking further, I took a look in malloc.h, where size_t is defined,
> on my Alpha and found
> 
>         #define size_t          unsigned int
> 
> shouldn't it be
> 
>         #define size_t          unsigned long int
> 
> on the Alpha???

With a C++ program, I get sizeof (size_t) == 8 on my alpha.  Part of the
-v info:

GNU C++ version egcs-2.90.23 980102 (egcs-1.0.1 release)
(alphaev5-unknown-linux-gnu) 

-- 
Dick Hadsell			914-381-8400  Fax: 914-381-9790
Reply-to:			hadsell@blueskystudios.com
Blue Sky | VIFX			http://www.blueskystudios.com
1 South Road, Harrison, NY 10528

-- 
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] 12+ messages in thread
* Re: GCC 64 bit compliance
@ 1998-04-29 17:18 brinkmann
  0 siblings, 0 replies; 12+ messages in thread
From: brinkmann @ 1998-04-29 17:18 UTC (permalink / raw)
  To: axp-list

Looking further, size_t is actually 8 bytes.  Looking at the preprocessor
output (cc -E "file"), I found the definition in the tree included by
<stdio.h> in the file
/usr/lib/gcc-lib/alpha-redhat-linux/2.7.2.3/include/stddef.h:

typedef long unsigned int size_t;

which is what it should be.  I have no idea why "include" files are in
the /usr/lib tree, but the immediate question is answered.

As to the use of "size_t", I haven't
seen a mention of it in any standard.  My comments are based on
perusing the /usr/include tree in various C implementations, both ANSI
and K&R, and various man pages for functions such as malloc.

Jon
---
Dr. Jon Brinkmann				Apache Point Observatory
Instrument Scientist				2001 Apache Point Road
Internet:	brinkmann@nmsu.edu		P.O. Box 59
URL:	http://www.apo.nmsu.edu/brinkmann/	Sunspot, NM 88349-0059


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

end of thread, other threads:[~1998-04-29 17:49 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1998-04-29 15:33 GCC 64 bit compliance brinkmann
1998-04-29 14:36 ` Stephen Williams
1998-04-29 17:09   ` Michal Jaegermann
1998-04-29 15:48     ` Stephen Williams
1998-04-29 16:22 ` Alexander V. Lukyanov
1998-04-29 16:27 ` Richard Hadsell
1998-04-29 16:45 ` Michal Jaegermann
1998-04-29 17:08   ` Dan Bethe
1998-04-29 17:34     ` Craig Burley
1998-04-29 17:53 ` Uncle George
  -- strict thread matches above, loose matches on Subject: below --
1998-04-29 16:53 Alan Wood
1998-04-29 17:18 brinkmann

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