K
Keith H Duggar
Thanks for the example Rolf.
Personally, I never pollute the global namespace with underscore
names. I was mainly thinking of continuing to use __xyz to indicate
member variables. I tried using m_xyz for a while but the code didn't
look nearly as nice as with __xyz. Also, I tried using xyz_ as many
suggest but again __xyz was much easier on my eyes and I take it that
xyz__ would also be reserved (double underscore) is that correct?
However, your example seems to indicate that I could run into name
mangling problems even within a class namespace.
Thank you again, I will have to look into this more.
PS. What convention to you use for member variable names?
int _Z4testv;
void test() {};
int main()
{
test();
}
The reason is that the internal mangled name for the function test is
_Z4testv, so there is a naming conflict with the global variable. The
error message looks like this:
/tmp/cckaLQYy.s: Assembler messages:
/tmp/cckaLQYy.s:13: Error: symbol `_Z4testv' is already defined
Personally, I never pollute the global namespace with underscore
names. I was mainly thinking of continuing to use __xyz to indicate
member variables. I tried using m_xyz for a while but the code didn't
look nearly as nice as with __xyz. Also, I tried using xyz_ as many
suggest but again __xyz was much easier on my eyes and I take it that
xyz__ would also be reserved (double underscore) is that correct?
However, your example seems to indicate that I could run into name
mangling problems even within a class namespace.
Thank you again, I will have to look into this more.
PS. What convention to you use for member variable names?