This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/31176] reorder class data members to minimize space waste



------- 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]