[aspectc-user] Definition collisions after weave
Olaf.Spinczyk at informatik.uni-erlangen.de
Fri Nov 3 16:13:11 CET 2006
as a general rule, C++ applications should not use identifiers that
start with '_'. Such identifiers are intended to be used only by the
implementation, i.e. the compiler (see paragraph 184.108.40.206.2 of the C++
standard). If it turns out that in practice such identifier are used by
applications and that it therefore comes to conflicts, we could still
modify the implementation and generate unique names.
Panu Bloigu wrote:
> Hello you all!
> The situation I'm going to describe may seem like minor curiosity rather
> than a real issue, but the principle behind it feels -- atleas to me -- kind
> of important.
> Let't say I have a class, say "ClassA", which has a method, say "void
> method()", as it's member. Also let's say that ClassA has another member
> named "void __exec_old_method()". Now, you probably guess where this is
> going... If I want to have some aspect code executed before execution of
> method()'s code, my C++ compiler gives me a compile time error. This happens
> because the AspectC++ weaver adds a member "void __exec_old_method()" to
> ClassA, which already has a similar member. So there will be two definitions
> of the same method.
> Like I said, this might seem like a non-issue to most, but doesn't this
> violate the "obliviousness" goal of AOP, because one has to know what
> methods she absolutely _can't_have_ as class members? As one gets familiar
> with AspectC++, he gets to know this and soon learns to avoid certain naming
> schemes in base code, but what if one has to add aspects to some base code
> which just happens to include a colliding method definitions and there is no
> way to change the existing base code? I'd like to hear what you all would do
> in such a situation.
> aspectc-user mailing list
> aspectc-user at aspectc.org
More information about the aspectc-user