Mailing-List: contact cygwin-apps-help AT cygwin DOT com; run by ezmlm Sender: cygwin-apps-owner AT cygwin DOT com List-Subscribe: List-Archive: List-Post: List-Help: , Delivered-To: mailing list cygwin-apps AT cygwin DOT com Message-ID: <20020201205943.16087.qmail@web14508.mail.yahoo.com> Date: Sat, 2 Feb 2002 07:59:43 +1100 (EST) From: =?iso-8859-1?q?Danny=20Smith?= Subject: w32api, DECLSPEC_NORETURN , and GCC-3.x To: cygwin-apps , mingw-dvlpr MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit 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 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!