This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Public / Private in headers
- From: Ferdinando Formica <s233500 at studenti dot ing dot unipi dot it>
- To: bug-gcc at gnu dot org
- Date: Mon, 1 Dec 2003 13:56:43 +0100 (CET)
- Subject: Public / Private in headers
I don't know if you consider this a bug, nor if it's been fixed in recent
versions of GCC, but I experienced this: when compiling a C++ module with
a class definition, member's names are exported without regard to their
visibility modificators. So, if I link that module with another containing
(and using) same members, but all declared public, I can access and modify
a class' internal structure: now, I know, I made the class and declaring
it in a different way is like shoot me in the foot, but this give me the
chance to create a derived class that can export as public the members
declared as private by its parent, in contrast with standard's
specifications, as far as I know.
Good bye and many compliments for the great job.
Ferdinando Formica