[aspectc-user] invalid member declaration near token `__asm__'

Olaf Spinczyk os at aspectc.org
Fri Apr 15 15:52:05 CEST 2011


Hi!

You found a bug. The following code does not compile with ag++ while it 
works with g++:

class c {
   static int foo __asm__("foo");
};

These "asm labels" are a gnu-compiler specific extension. They are 
implemented by the ac++ parser for global and local variables, but the 
case of static class members is missing. It probably happened, because 
the gcc/g++ documentation does not mention asm labels for static class 
members.

We'll fix it if you write a bug report at www.aspectc.org/bugzilla. ;-)

- Olaf


On 04/15/2011 02:58 PM, Guilherme . wrote:
>
> Hi!
>
> I'm getting this error but i can't figure out why. One of the macros 
> used in the ecos source expands ultimately to
>
> volatile variable_type variable __asm__("label_in_asm_code");
>
> but ac++ seems to be having problems with it. Other defines seem to 
> expand properly.
>
> Here is the occurence in the code:
>
> First file using using a define that expands into __asm__:
>
> 256 class Cyg_Scheduler_SchedLock
> 257 {
> 258     static volatile cyg_ucount32 sched_lock         // lock counter
> 259                     CYGBLD_ATTRIB_ASM_ALIAS( 
> cyg_scheduler_sched_lock )
> 260                     CYGBLD_ANNOTATE_VARIABLE_SCHED
> 261                     ;
>
> File with the definitions of the defines:
>
> 375 #ifndef CYG_LABEL_DEFN
> 376
> 377 #define CYG_LABEL_DEFN(_label) _label
> 378
> 379 #endif
> ...
> 411 # if !defined(CYGBLD_ATTRIB_ASM_ALIAS)
> 412 #  define __Str(x) #x
> 413 #  define __Xstr(x) __Str(x)
> 414 #  define CYGBLD_ATTRIB_ASM_ALIAS(__symbol__) \
> 415              __asm__ ( __Xstr( CYG_LABEL_DEFN( __symbol__ ) ) )
> 416 # endif
> ...
> 519 #ifndef CYGBLD_ANNOTATE_VARIABLE_SCHED
> 520 #define CYGBLD_ANNOTATE_VARIABLE_SCHED
> 521 #endif
>
> Is there anything i can do to further help in the anaylisis?
>
> Cheers,
> Guilherme
>
>
> _______________________________________________
> aspectc-user mailing list
> aspectc-user at aspectc.org
> http://www.aspectc.org/mailman/listinfo/aspectc-user
>    

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.aspectc.org/pipermail/aspectc-user/attachments/20110415/f6c9f95a/attachment.html>


More information about the aspectc-user mailing list