Recent changes to attribute handling in GCC fix some *really important* problems with handling of attributes in C++, particulary with dllimport of class definitions. cp/Changelog 2002-01-31 Jason Merrill <[EMAIL PROTECTED]>
PR c++/3395 * decl.c (xref_tag): Remember early attributes in TYPE_ATTRIBUTES, not TREE_TYPE. * semantics.c (finish_class_definition): Adjust. Allow attributes in parms and casts. * parse.y (named_parm): Don't strip attrs. (declmods): Remove 'attributes' production. (nonempty_cv_qualifiers): Accept attributes. (ATTRIBUTE): Give precedence. * decl.c (groktypename): Handle attributes. (grokparms): Likewise. However they also cause parse errors at four places in the w32api headers (but only with C++); rpcdce.h:362:DECLSPEC_NORETURN void RPC_ENTRY RpcRaiseException(RPC_STATUS); winbase.h:1059:DECLSPEC_NORETURN void WINAPI ExitProcess(UINT); winbase.h:1060:DECLSPEC_NORETURN void WINAPI ExitThread(DWORD); winbase.h:1095:DECLSPEC_NORETURN void WINAPI FreeLibraryAndExitThread(HMODULE,DWORD); The parse errors can be fixed quite simply by putting the __attribute__((noreturn)) at the end of the prototype rather than the beginning in the w32api headers. I am not going to report this as a bug to GCC yet since the local fix is so easy. Placing the attribute after the function is the logical (sensu GCC) thing to do anyway. Just a heads up for others testing GCC. Danny http://my.yahoo.com.au - My Yahoo! - It's My Yahoo! Get your own!