From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (qmail 12085 invoked from network); 21 Nov 1998 13:19:59 -0000 Received: from mail.redhat.com (199.183.24.239) by lists.redhat.com with SMTP; 21 Nov 1998 13:19:59 -0000 Received: from post.mail.demon.net (post-12.mail.demon.net [194.217.242.41]) by mail.redhat.com (8.8.7/8.8.7) with ESMTP id IAA16472 for ; Sat, 21 Nov 1998 08:19:58 -0500 Received: from [194.222.210.232] (helo=tardis.home.dave) by post.mail.demon.net with smtp (Exim 2.053 #1) id 0zhCxB-0000JT-00 for axp-list@redhat.com; Sat, 21 Nov 1998 13:19:57 +0000 Date: Sat, 21 Nov 1998 13:18:44 +0000 (GMT) From: Dave Gilbert X-Sender: gilbertd@tardis.home.dave To: axp-list@redhat.com Subject: Re: Writing portable Code for Glibc and 32/64 bit In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII A portability problem I have tried to figure out a good soloution for is that of structure sizes in arrays - e.g. struct frob { void *a; void *b; int x; int dummy; } Now that isn't unreasonable is it? Size on 32 bit machine 16, size on 64 bit machine 24. The problem is that say I made a big array out of those, and you want to make sure that the compiler uses shift rather than multiply to address it. This will happen on the 32 bit machine but not the 64 because of the non-power of 2 size. How does one write a structure of a mixture of pointers and ints etc while guarenteeing it will be a power of 2 in size? Dave -------------------------------------------------------------------- / Dr. David Alan Gilbert | Running Linux on Alpha(LX) | Happy \ \ gro.gilbert @ treblig.org | & ARM(EBSA285,old Arc) | In Hex / \____________________________|___ http://www.treblig.demon.co.uk __/