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

Olaf Spinczyk os at aspectc.org
Thu May 28 23:29:39 CEST 2009


Hi Steven,

I slightly modified your code in order to avoid problems with undefined
types and identifiers (uint8_t, method, ...) and compiled it with ac++
1.0pre3. This produced the error messages which you also got.

However, with the latest version from the subversion repository it
compiled with no errors. The problems seems to be related to the gcc
extension 'labels as value' (the &&label stuff). I remember that the
necessary parser extension has been implemented after version 1.0pre3
was released.

If you need a binary for linux or windows, let me know ...

Cheers,

Olaf

steven schrieb:
> 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
> _______________________________________________
> 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