From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20974 invoked by alias); 9 Jul 2004 16:28:40 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 20966 invoked from network); 9 Jul 2004 16:28:39 -0000 Received: from unknown (HELO lon-mail-3.gradwell.net) (193.111.201.127) by sourceware.org with SMTP; 9 Jul 2004 16:28:39 -0000 Received: (qmail 83962 invoked from network); 9 Jul 2004 16:28:38 -0000 Received: from digraph.polyomino.org.uk (postmaster%pop3.polyomino.org.uk@81.187.227.50) by lon-mail-3.gradwell.net with SMTP; 9 Jul 2004 16:28:38 -0000 Received: from jsm28 (helo=localhost) by digraph.polyomino.org.uk with local-esmtp (Exim 4.34) id 1BiyEn-0007Ex-QQ; Fri, 09 Jul 2004 16:28:37 +0000 Date: Fri, 09 Jul 2004 18:22:00 -0000 From: "Joseph S. Myers" X-X-Sender: jsm28@digraph.polyomino.org.uk To: Jan Beulich cc: zack@codesourcery.com, gcc-patches@gcc.gnu.org Subject: Re: enable maximum integer type to be 128 bits In-Reply-To: Message-ID: References: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-SW-Source: 2004-07/txt/msg00978.txt.bz2 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 : 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)