[prev in list] [next in list] [prev in thread] [next in thread] 

List:       gccxml
Subject:    Re: [GCC-XML] Adding meta-information.
From:       Brad King <brad.king () kitware ! com>
Date:       2008-03-30 19:42:14
Message-ID: 47EFED16.9000206 () kitware ! com
[Download RAW message or body]

Chris Waldron wrote:
> I noticed in the documentation that GCC-XML support the ability to add 
> meta-information in the C++ source that can be read by GCC-XML as follows…
> 
>  
> 
> |*__attribute((gccxml(<string>, <string>, ...)))*|: Here <string> is a 
> quoted string. There must be at least one argument to the 'gccxml' 
> attribute, but there is no upper limit to the total number of arguments. 
> Each argument is verified to be a string - if a non-string argument is 
> found, the attribute is ignored.
> 
>  
> 
> What I’d like to know is whether this will work for Microsoft C++ as 
> well or is this feature specific for GCC.

The __attribute syntax is specific to gcc, but that's okay.  The syntax will 
work in gccxml no matter what compiler you are simulating because gccxml 
always parses using a patched gcc parser.  You just have to use macros to 
avoid using the attribute syntax when a compiler other than gccxml is in use:

#ifdef __GCCXML__
# define MY_GCCXML_ATTRIBUTES(x) __attribute(x)
#else
# define MY_GCCXML_ATTRIBUTES(x)
#endif

Then in the code use the macro to specify attributes.  All compilers will 
ignore them but gccxml will see them.

-Brad
_______________________________________________
gccxml mailing list
gccxml@gccxml.org
http://www.gccxml.org/mailman/listinfo/gccxml

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic