[aspectc-user] ac++ fails at asm-keyword

Olaf Spinczyk os at aspectc.org
Fri Jun 13 14:26:41 CEST 2008


Hi,

J. Liebig wrote:
> Hi,
>
>> you might want to try a simple trick:
>>
>> #ifdef __puma
>>     #define asm(CODE)
>> #endif
> this works for me.
>
>> that replaces asm() statements with nothing.
>> I haven't checked but don't one have to put curly braces {} around 
>> asm statements?
> The asm-definition in the book "The C++ Programming Language" by 
> Bjarne Stroustrup says:
> asm( string-literal ) ;

Yes, we know. :-)

The asm primitive (even with most gcc extensions) was implemented years 
ago. However, in your example asm was not used as a statement or 
declaration. As Matthias wrote, this special feature, which I hadn't 
seen before, was implemented only recently.

Note that in the C++ standard "asm ( string-literal ) ;" is an 
asm-definition. It can be used a kind of declaration or declaration 
statement. However, it cannot be used after a function declarator. This 
seems to be a g++ language extension.

>
>
>
> But another question appears now. I'm using the avr-glibc. Since this 
> is a C-library, I'd like to
> know, how far is the compatibility of the aspectc++ concerning C.
As long as you don't want to weave *inside* the avr-glibc it should be 
no problem. BTW, is avr-glibc the same as avr-libc from 
www.nongnu.org/avr-libc/? The latter has been used with AspectC++ for 
quite some time without trouble.

Best regards,

Olaf




More information about the aspectc-user mailing list