[aspectc-user] Compiling an existing pure C project with AspectC++ using Eclipse or manually

Olaf Spinczyk os at aspectc.org
Tue Jan 19 09:44:31 CET 2016


Hi!

I'm sorry, but it would take you a few hours/days of manually turning 8cc into
C++-compliant code before you can compile it with ac++.

The problem is that not every valid C program is also a valid C++ program. For
example, in C you can convert a 'void *'-typed object into a pointer of
arbitrary base type. In C++ an explicit type cast is required for doing that.
Furthermore, 8cc uses C11-specific keywords such as _Noreturn and C99-style
aggregate initialization. Therefore, the Clang-based frontend of ac++ generates
lots of error messages.

In theory, one could configure the parser of ac++ to be a pure C-parser.
However, this alone wouldn't help much, because the transformed code strongly
relies on C++ templates. One would end up with a mix of C11 and C++ code, which
couldn't be compiled by any compiler.

Best regards,

Olaf Spinczyk


On 12/29/2015 04:23 AM, Arefin Sami wrote:
> Hello, 
> I am quite new in AspectC++ and I have to use it to produce execution trace
> required for my research. My intention is to run the unit tests and get the
> execution trace (e.g., method signature). I created a new AspectC++ project in
> Eclipse-Ubuntu and it works fine with my aspects. But I would like to use it
> with an existing pure C project (e.g., https://github.com/rui314/8cc) which
> has its own makefile in its root directory. I manually replaced all the cc
> commands with ac++ but it does not work. May be its not the right way. Would
> you please help me out compiling the whole project with AspectC++ with a very
> simple aspect.
> Thank you.
>
> -- 
> * *
> *Your Faithfully*
> *Syed Samsul Arefin*
> Graduate Student
> Department of Computer Science
> University of Manitoba, MB, Canada.
> http://bd.linkedin.com/pub/syed-samsul-arefin-sami/45/3a7/591/
> /*Please don't print this email unless you really need to. Let's save some
> trees!*/
> <https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail>
> 	This email has been sent from a virus-free computer protected by Avast.
> www.avast.com
> <https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail>
>
>
>
>
> _______________________________________________
> aspectc-user mailing list
> aspectc-user at aspectc.org
> http://www.aspectc.org/mailman/listinfo/aspectc-user


-- 
Prof. Dr.-Ing. Olaf Spinczyk
http://ess.cs.tu-dortmund.de/~os

TU Dortmund, Informatik 12        PGP-Key: 0xCABA5D80
Otto-Hahn-Str. 16                 Phone:   +49.231.7556322
44221 Dortmund, Germany           Fax:     +49.231.7556116




More information about the aspectc-user mailing list