From: Michal Jaegermann <michal@ellpspace.math.ualberta.ca>
To: axp-list@redhat.com
Subject: Re: GCC 64 bit compliance
Date: Wed, 29 Apr 1998 10:45:15 -0600 (MDT) [thread overview]
Message-ID: <199804291645.KAA14789@ellpspace.math.ualberta.ca> (raw)
In-Reply-To: <199804291533.JAA18562@galileo.apo.nmsu.edu> from "brinkmann@nmsu.edu" at Apr 29, 98 09:33:25 am
>
> 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???
Which version of libraries, headers, etc. you are using? And are
you sure that you are looking at the right place? Headers are often
included behind muli-story defines are macro-expansions and their
text likely covers more than one platform.
Doing a real check, which consists of running a program like that:
#include <stdio.h>
int
main(void)
{
printf("%ld\n", sizeof(size_t));
return 0;
}
I see a number 8 (glibc-2.0.7-7 and its headers on Alpha) but AFAIK
it was always like that.
Saying that - to assume in your programs some particular widths of
types, beyond what C standard says about their relative widths,
is a bad practice. It leads to numerous bugs which later haunt
us on Alpha. Some programmer knew what these sizes were and now
we have to "port" (translation - fix) this code for Alpha.
Bugs are masked on a platform when assumptions about sizes happens
to be true and the original code is passing for a correct one.
Michal
next prev parent reply other threads:[~1998-04-29 16:45 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
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
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