[aspectc-user] code compiles with g++, but not with ag++

steven stevdev at web.de
Thu May 28 19:58:00 CEST 2009


hello,

I have code that is compiled with g++ without errors, but is not  
compiled with ag++.
the code is not woven by an aspect.

this is the piece of code:

/////////begin code/////////////////////
#define DISPATCH \
         uint8_t bytecode = method->GetBytecode(0); \
         goto *labels[bytecode&0xF]

void Interpreter::Start() {
     void** labels;
     goto start;

     DO_HALT: {
         return;
     }


     DO_DUP: {
         DISPATCH;
     }


     DO_PUSH_LOCAL: {
         DISPATCH;
     }


start:
     void* _labels[3] = {&&DO_HALT, &&DO_DUP, &&DO_PUSH_LOCAL};
     labels = _labels;

     DISPATCH;
}//end Start()
/////////end code/////////////////////

and this is the error message by ag++:

ag++ -g -Wno-endif-labels -O3 -a src/interpreter/ 
DecodeDispatchInterpreterAspect.ah -a src/memory/MarkSweep.ah -k -v1 -- 
configpuma.config -csrc/interpreter/Interpreter.cpp -osrc/interpreter/ 
Interpreter.o
*
*
* AG++ Configuration:
*   Create puma.config: 0
*   Aspect C++ weaver:  ac++
*   C++ compiler:       g++
*   Files:              src/interpreter/Interpreter.cpp
*   Options (G++):       -g -Wno-endif-labels -O3 -c -I"/src/ 
interpreter/"
*   Options (AC++):      -a"src/interpreter/ 
DecodeDispatchInterpreterAspect.ah" -a"src/memory/MarkSweep.ah" -k -v1  
-p.
*   Options (total):     -g -Wno-endif-labels -O3 -a"src/interpreter/ 
DecodeDispatchInterpreterAspect.ah" -a"src/memory/MarkSweep.ah" -k -v1  
-csrc/interpreter/Interpreter.cpp -I"/src/interpreter/" -p.
*   Weave: 1 Compile: 1 Link: 0
*
*
* Weaving
* Running ac++ 1.0pre3
* Handling Translation Unit `Interpreter.cpp'.
/src/interpreter/Interpreter.cpp:74: error: invalid statement near  
token `goto'
/src/interpreter/Interpreter.cpp:79: error: invalid statement near  
token `goto'
/src/interpreter/Interpreter.cpp:83: error: invalid statement near  
token `:'
/src/interpreter/Interpreter.cpp:87: error: invalid statement near  
token `goto'
/src/interpreter/Interpreter.cpp:66: error: label `start' used but not  
defined
/src/interpreter/Interpreter.cpp:85: error: `_labels' undeclared here
error: Execution failed: "ac++" --config "/puma.config"  -a"src/ 
interpreter/DecodeDispatchInterpreterAspect.ah" -a"src/memory/ 
MarkSweep.ah" -k -v1 -p. -c "/src/interpreter/Interpreter.cpp" -o "/ 
src/interpreter/Interpreter.acc"
make: *** [/src/interpreter/Interpreter.o] Error 1


is ag++ having problems with the DISPATCH macro?


regards,

steven



More information about the aspectc-user mailing list