On 02/28/2012 04:01 PM, Bruno Haible wrote: > But unfortunately there are also other possible elements in a declspec > list, see [1]. I don't see how to accommodate these.
[1] is for Visual Studio 2005; Visual Studio 2010 also has 'safebuffers' <http://msdn.microsoft.com/en-us/library/dabb5z75%28v=vs.100%29.aspx>. If this latter is an exhaustive list, can we wrap each of these? E.g., define __wrapped_align, __wrapped_allocate, __wrapped_appdomain, etc. (I confess that I didn't follow the MSVC example you gave, or why your simpler idea didn't work with MSVC.) I notice that the corresponding section for C <http://msdn.microsoft.com/en-us/library/k2f5w4h3.aspx> doesn't list 'noreturn'. Does __declspec(noreturn) work only with C++? If so, then we need to worry about this issue only for C++. Or is the C part of the documentation out-of-date? > The other, equally extreme, solution is to add > > #ifdef _MSC_VER > # include <stdlib.h> > # include <setjmp.h> > # include <process.h> > #endif Is this the complete list of MSVC include files that use __declspec(noreturn)? If so, that might work too. But it sounds more fragile than wrapping the list of __declspec keywords. Thanks for these ideas. If either of them work, I suppose we can use them, but if there are problems with both of them at least we have the simpler fallback of "#define noreturn /* nothing */" on MSVC.