Path: utzoo!mnetor!uunet!lll-winken!lll-lcc!lll-tis!ames!nrl-cmf!mailrus!umix!umich!mibte!gamma!ulysses!allegra!alice!bs From: bs@alice.UUCP Newsgroups: comp.lang.c++ Subject: Re: debuggers Message-ID: <7712@alice.UUCP> Date: 23 Feb 88 19:20:38 GMT References: <275@goofy.megatest.UUCP> <7711@alice.UUCP> Organization: AT&T Bell Laboratories, Murray Hill NJ Lines: 24 Keywords: debugger Summary: another example Class member names are given prefixes by cfront to make them unique in a generated struct declaration not to please ancient C compilers that do not understand non-unique member names in different structs. An example of the use of class member prefixes for data members: class A { short a; char aa; public: ... }; class B : public A { char a; public: ... }; Here a B has two members called `a' the C code generated must use two different names for them. For example: struct B { short A_a; char A_aa; char B_a; }; An alternative code generation strategy would generate a member of B of type `struct A' and avoid the prefixes, but on most machines this would cause the size of B to increase because of alignment requirements. I chose to make the 'a's private simply to give a plausible example.