[aspectc-user] Compiler Error - Related Error being fixed in (Version 1.0pre1: 10/2005)?

John C. Weicher jweicher at piocon.com
Tue Oct 18 22:40:00 CEST 2005


I am running into an odd error during compilation that only crops up when I
provide two separate advice calls which affect the same function.

 

Simplified scenario exists where there is

 

someFunctionA(){

 

  //blah blah

  

  someFunctionB();

 

  //blah blah

}

 

I have already defined an aspect with advice as follows:

 

advice call("% %someFunctionB(...)") && within("% %someFunctionA(...)") :
around() {  //blah blah }

 

Obviously I am trying to call around function B when called from within A (I
do some other stuff, and then let it proceed).  This weaves, parses,
compiles and runs beautifully.  I've been using this in a working
application for some time now.

 

A new situation has arisen for me now where in addition to the above
(situation is the same, and the previous advice block is also still needed
and in place), I ALSO want to define an additional advice block to perform
some operations before the execution of function A, done as follows:

 

advice execution("% %someFunctionA(...)") : before() {  // blah blah }

 

This is causing problems.  Weaving still occurs without error, but when I
then try to compile weaved code, I receive the following error (changed the
function names to match my fake example above, so it makes sense):

 

: In function `int someFunctionA(args args args.)':

:4: `__exec_old_someFunctionA' undeclared (first use this function)

:4: (Each undeclared identifier is reported only once for each function it

   appears in.)

./thefile.c: In function `int __exec_old_someFunctionA(args arg args)':

./thefile.c:280: `int __exec_old_someFunctionA(args args args)

   ' used prior to declaration

 

And sure enough, when I go into the file the inline definition for
__exec_old_someFunctionA is coming after the modified call to it.  But I
didn't think this mattered with inline functions. 

 

I apologize for the lengthy post, but I am definitely confused.  If I take
the new additional advice block back out, everything compiles fine again.

 

I also noticed that although that it specifically mentions only classes,
this sounds very similar to the issue that is supposed to be fixed in the
new release mentioned on the Roadmap page: "fix for the HUGE problem of ac++
0.9.3 that causes parse errors, when an aspect defines code advice for a
class into which it also introduces new functions/members".  

 

Is this the case, and if so is there a workaround in the meantime?

 

 

 

 

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.aspectc.org/pipermail/aspectc-user/attachments/20051018/9ccc0cf8/attachment.html>


More information about the aspectc-user mailing list