From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2100 invoked by alias); 14 Mar 2007 19:04:34 -0000 Received: (qmail 2050 invoked by uid 48); 14 Mar 2007 19:04:20 -0000 Date: Wed, 14 Mar 2007 19:04:00 -0000 Message-ID: <20070314190420.2049.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug c++/31176] reorder class data members to minimize space waste In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "sebor at roguewave dot com" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2007-03/txt/msg01321.txt.bz2 ------- Comment #3 from sebor at roguewave dot com 2007-03-14 19:04 ------- (In reply to comment #1) > Interesting. Do the attributes apply to derived classes automatically? I would say no. > [...] > Is D also allowed to reorder members a and b? even with an explicit > __attribute__((reorder))? I'm afraid I don't know enough to give an informed answer but my gut tells me that it might be safer to have the programmer explicitly ask for the base class padding to be used to store members of the derived class (e.g., via some creative application of the attribute in the definition of the derived class) rather than having the compiler do it automatically for them. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31176