[aspectc-user] Boost problems

Olaf Spinczyk os at aspectc.org
Fri Jul 23 17:05:17 CEST 2010


Hello Abe,

thanks for providing your files on a linked web page. This is very helpful.

The definition of your aspect InterestCalculator is lacking a semicolon 
at the end. Furthermore, I'd recommend to use an include guard in every 
aspect header file.

However, even if you fix these issues, ac++ will have problems with the 
boost headers that you are using here. boost is based on very 
sophisticated template features and makes use of a lot of conditional 
compilation in order to cope with the different interpretations of the 
C++ standard as is implemented by the supported compilers. Therefore, 
ac++ still has problems with boost. Even though we are continuously 
improving the parser, I wouldn't expect a short-term solution. Sorry.

Your second question was whether you could restrict the set of woven 
files. This is possible, but a bit tricky. You have to know what you are 
doing.

If you use the "single translation unit mode", e.g. by weaving and 
compiling with ag++, you are free to use ag++ for some files of your 
project and g++ for the rest. However, this will only work if the 
weaving process does not affect any header files that are shared between 
both groups of translation units. If the files that are compiled with 
g++ depend on modifications in header files, e.g. introduced attributes 
in a class, you need to create transformed header files with the ag++ 
command line option "-i". However, this will transform *all* header 
files of the project, which means that header files must not include 
critical boost headers. :-( I don't know if this is possible in your case.

Also note that you can filter the code that is parsed by ac++ with 
#ifndef __puma ... #endif. However, you can't simply hide the inclusion 
of boost header files with this feature, because the boost definitions 
will probably be needed at many points in your code. At all these places 
you would also have to use #ifndef __puma.

I hope this helps a little.

- Olaf


Abe S. wrote:
> Hi all,
>
> I have a medium-sized project (Over 200 but less than 300 files) which
> makes fairly heavy use of Boost for threading, messaging, and
> configuration parsing. I am trying to use AspectC to add
> interestingness and abstractness metrics to data being processed by
> the system. If that works, I'm probably also going to move the logging
> over to an aspect.
>
> I've used AspectC on a small sample program, and been very pleased
> with the results. However, when I attempt to add a "hello world"
> aspect to one of the classes of the existing project, I get a large
> variety of error messages, most of which include some reference to
> boost header files.
>
> It looks much like the error messages reported in:
> http://www.aspectc.org/pipermail/aspectc-user/2006-February/000908.html
> http://www.aspectc.org/pipermail/aspectc-user/2009-February/001368.html
>
> I have attempted to work around this by using the --weave_only option
> and then compiling the woven source as normal, but the weaving appears
> to be the part that fails. Using --real-instances causes a different
> initial error, and then the same errors as not using it.
>
> Is there a way to restrict the weaver to only working with a subset of
> the source files, so that I can have it ignore anything from the boost
> libraries?
>
> If it's useful (and even if it's not), the full error messages, aspect
> header, and source file are in
> http://aculei.net/~ams/aspectc_err_msgs/
>
> -Abe
> _______________________________________________
> 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