[aspectc-user] adding aspects to .h and .c files

Jamal Siadat siadat at cpsc.ucalgary.ca
Fri May 13 10:27:22 CEST 2005

I have a class "A" declared in "A.h" and implemented in "A.cc". I want to
add a variable to the class A so I have an aspect adding this variable to
A.h. I also have an around advice to change the method functionality in
Both of the aspects compile individually with their respective files But
together they dont! ( it works if I only try to compile the first aspect
with A.h or if I try to compile the second aspect with A.cc  one or the
other but not both together). If I have compiled the first aspect with A.h
and try to compile the second aspct with A.cc I get a "Segmentation fault"
messege and the aspect wont compile into A.cc.

Here it is in c++:

class A {
  int a(const char *name, float b);

int A::a( const char *name, float b) {
  printf("inside A::a( %f)\n",  b);
  return jam;

1st.ah // to compile with A.h

aspect Cache  {
pointcut shapes() = "A";
advice shapes() :  int jam;

2nd.ah // to compile with A.cc

aspect A2{
  advice execution("% A::%(...)") : around()  {
printf("A: before(exec) %s\n", JoinPoint::signature());

When I compile the second aspect "2nd.ah" with A.cc I get "Segmentation
fault". Is there any way to beat this and fix this error?

Thanks for your help,

More information about the aspectc-user mailing list