From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24209 invoked by alias); 23 Apr 2003 18:18:56 -0000 Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org Received: (qmail 24114 invoked from network); 23 Apr 2003 18:18:53 -0000 Received: from unknown (HELO gash2.peakpeak.com) (207.174.178.17) by sources.redhat.com with SMTP; 23 Apr 2003 18:18:53 -0000 Received: from fleche.redhat.com (tf0199.peakpeak.com [204.144.239.199]) by gash2.peakpeak.com (8.9.3/8.9.3.1) with ESMTP id MAA02668; Wed, 23 Apr 2003 12:18:42 -0600 Received: by fleche.redhat.com (Postfix, from userid 1000) id 6D3264F80D0; Wed, 23 Apr 2003 12:11:25 -0600 (MDT) To: Jason Merrill Cc: Jamie Lokier , Andrew Haley , gcc@gcc.gnu.org Subject: Re: On alignment References: <200303251122.13693.kevin.hendricks@sympatico.ca> <200303251344.59988.kevin.hendricks@sympatico.ca> <16037.6826.35777.756256@cuddles.redhat.com> <20030423124944.GA24593@mail.jlokier.co.uk> <87wuhlgq5l.fsf@fleche.redhat.com> From: Tom Tromey Reply-To: tromey@redhat.com X-Attribution: Tom X-Zippy: Uh-oh!! I'm having TOO MUCH FUN!! Date: Wed, 23 Apr 2003 18:42:00 -0000 In-Reply-To: Message-ID: <87lly1f5ir.fsf@fleche.redhat.com> User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-SW-Source: 2003-04/txt/msg01166.txt.bz2 >>>>> "Jason" == Jason Merrill writes: [ about struct foo { double x; } ] Tom> I'd like to find the most future-proof way to do this. In the above, Tom> is __alignof__(foo::x) the best way? I'm only concerned with Tom> alignment of fields. Jason> It is since my recent patch to do all alignment calculation for Jason> fields in layout_decl. I can't do this. struct aligner { double field; }; int compute () { return __alignof__ (aligner::field); } fleche. gcc -c y.cc y.cc: In function `int compute()': y.cc:1: error: invalid use of non-static data member `aligner::field' y.cc:3: error: from this location I can use __alignof__(aligner), but my concern is that eventually this will yield "8" instead of "4" on x86. libgcj really needs to know the alignment required in structures, for compatibility with the compiler. Preferably we'd have the compiler tell us this info. Tom