daniel.santos Posted October 10, 2011 Report Share Posted October 10, 2011 (edited) ../../../source/lib/allocators/headerless.cpp:757: error: attributes are not allowed on a function-definitionMy understanding of __attribute__ (nothrow) is that it is an optimization feature to prevent the compiler from generating unwind code. I would recommend consulting an expert on this, but I believe the c++ throw() clause will accomplish the same thing (as in MSVC) and you can (and actually, must) stick it on both the declaration and the definition, whereas gcc only accepts the attribute on the definition.See http://gcc.gnu.org/o...Attributes.html for the vague details. --- lib/code_annotation.h (revision 10384)+++ lib/code_annotation.h (working copy)@@ -63,7 +63,8 @@ * smaller and more efficient code. **/ #if GCC_VERSION >= 303-# define NOTHROW __attribute__((nothrow))+//# define NOTHROW __attribute__((nothrow))+# define NOTHROW throw() // special meaning, equivalent to __declspec(nothrow) #elif MSC_VERSION # define NOTHROW throw() // special meaning, equivalent to __declspec(nothrow) #elseAlternately, you can make a separate macros for the declaration & definition. Edited October 10, 2011 by daniel.santos Quote Link to comment Share on other sites More sharing options...
fcxSanya Posted October 10, 2011 Report Share Posted October 10, 2011 Hello.Thanks for posting this topic and information. I created ticket on Trac and sent message to Jan, who is working on this code. Quote Link to comment Share on other sites More sharing options...
janwas Posted October 10, 2011 Report Share Posted October 10, 2011 Thanks for the report! I was not aware about the restriction on definitions and still haven't found any mention of it.The closest is http://www.mail-archive.com/commits@stdcxx.apache.org/msg00960.html, which also use the separate DEFINE/DECLARE approach. It's ugly, but preferable to possible pessimization via throw(), so I'll go with that approach.Am about to commit a fix; sorry about the breakage. Quote Link to comment Share on other sites More sharing options...
Shield Bearer Posted October 11, 2011 Report Share Posted October 11, 2011 Sorry to go off topic, but you wouldn't be Daniel Santos from the Glest forums, would you? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.