[aspectc-user] function call

Olaf Spinczyk os at aspectc.org
Thu Apr 1 11:45:45 CEST 2010


Hello!

I tested your first example and it works here.

Have you noticed that the closing bracket "}" of your advice code is 
missing?

In the second example the call goes to b1(), but the function is named 
ba1().

Best regards,

Olaf Spinczyk


Bin Du wrote:
> hi all,
> i have a question, haw can i call a c++ function in aspectc++
>
> -------------main.cc----------------------
>
> void func1 ( ) { ... };
> void func2 ( ) { ... };
> int main ( ) {
>                     func1 ( );
>                   //func2 ( );   
> }
>
> -----------test.ah--------------------
>
> aspect test{
>  advice execution("% func1 (...) ") : before () {
>         func2 ( ); 
> };
>
> ac++ issues the error:
>                                  error: `func2' undeclared here
>
>
> ----------------------- main2.cc-----------------
>
> class Base1
> {
> public:
>    void ba1 ()
>     {
>      printf("Base2::b1 ()\n");
>     }
> }base1;
>
> class Base
> {
> public:
>
>     int b2 (inti)
>     {   inttemp = i;
>         return temp;
>     }   
> } *a ;
>
> int main()
> {
>    
>     a->b2(0);
>
>     //base1.b1(); same problem
>
>     return 0;
> }
>
> Thanks in advance,
> du bin
> ------------------------------------------------------------------------
>
> _______________________________________________
> aspectc-user mailing list
> aspectc-user at aspectc.org
> http://www.aspectc.org/mailman/listinfo/aspectc-user
>   




More information about the aspectc-user mailing list