This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: enable maximum integer type to be 128 bits
- From: "Joseph S. Myers" <jsm at polyomino dot org dot uk>
- To: Jan Beulich <JBeulich at novell dot com>
- Cc: zack at codesourcery dot com, gcc-patches at gcc dot gnu dot org
- Date: Fri, 9 Jul 2004 16:28:37 +0000 (UTC)
- Subject: Re: enable maximum integer type to be 128 bits
- References: <s0ee62da.060@emea1-mh.id2.novell.com>
On Fri, 9 Jul 2004, Jan Beulich wrote:
> >2) sizeof(long) >= sizeof(any standard typedef, especially size_t).
>
> This is not, and never has been. See P64 data models on 64-bit archs
> (as used by Windows among others), and also ILP32 ones (where long long
The GNU Coding Standards, which GCC contributors are expected to have
read, state the requirements on supported hosts for GNU software
<http://www.gnu.org/prep/standards_28.html>:
Similarly, don't make any effort to cater to the possibility that long
will be smaller than predefined types like size_t. For example, the
following code is ok:
printf ("size = %lu\n", (unsigned long) sizeof array);
printf ("diff = %ld\n", (long) (pointer2 - pointer1));
1989 Standard C requires this to work, and we know of only one
counterexample: 64-bit programs on Microsoft Windows IA-64. We will
leave it to those who want to port GNU programs to that environment to
figure out how to do it.
Predefined file-size types like off_t are an exception: they are
longer than long on many platforms, so code like the above won't work
with them. One way to print an off_t value portably is to print its
digits yourself, one by one.
I.e., 64-bit Windows that breaks that assumption is not a host of interest
for GNU software. Someone might contribute target support
(cross-compilation only) for such a system, though the type sizes wouldn't
conform to the relevant standards (currently there's avr with -mint8 as
such a nonconforming setup; there used to be more targets that didn't
conform, e.g. with 32-bit long long, but they seem to have been
obsoleted).
--
Joseph S. Myers http://www.srcf.ucam.org/~jsm28/gcc/
jsm@polyomino.org.uk (personal mail)
jsm28@gcc.gnu.org (Bugzilla assignments and CCs)