This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Deprecate -fpack-struct for C++?
- From: "Giovanni Bajo" <giovannibajo at libero dot it>
- To: <gcc at gcc dot gnu dot org>
- Cc: "Nathan Sidwell" <nathan at codesourcery dot com>
- Date: Fri, 20 Feb 2004 03:51:52 +0100
- Subject: Deprecate -fpack-struct for C++?
Hello,
-fpack-struct cannot be used correctly in average C++ code. v3 is totally
incompatible with it (you can't even include the headers without getting a flow
of errors related to taking addresses/binding references to packed members of
classes) and the option does not discriminate between system headers and user
code. Plus, it triggers a segfault, see PR 14173. We have two options:
- Deprecate -fpack-struct for C++. I'd like to deprecate it in 3.4 and remove
it from mainline. I guess it's not so widespread for C++ given the above issues
anyway. And we are not losing any semantic power since we still have attribute
packed anyway.
- Fix -fpack-struct to affect only user structures, so that it becomes usable
somehow. This could be done checking if the structure is declared in system
headers, or checking if the enclosing namespace is std (assuming that v3 code
has to sit in namespace std anyway).
Comments?
Giovanni Bajo