diff --git a/code/FBXDocumentUtil.h b/code/FBXDocumentUtil.h index 7ff71937c..6f150b6d5 100644 --- a/code/FBXDocumentUtil.h +++ b/code/FBXDocumentUtil.h @@ -50,8 +50,8 @@ namespace Util { /* DOM/Parse error reporting - does not return */ -void DOMError(const std::string& message, const Token& token); -void DOMError(const std::string& message, const Element* element = NULL); +AI_WONT_RETURN void DOMError(const std::string& message, const Token& token) AI_WONT_RETURN_SUFFIX; +AI_WONT_RETURN void DOMError(const std::string& message, const Element* element = NULL) AI_WONT_RETURN_SUFFIX; // does return void DOMWarning(const std::string& message, const Token& token); diff --git a/code/ValidateDataStructure.h b/code/ValidateDataStructure.h index e33bb5b82..4a3ec86d2 100644 --- a/code/ValidateDataStructure.h +++ b/code/ValidateDataStructure.h @@ -82,7 +82,7 @@ protected: /** Report a validation error. This will throw an exception, * control won't return. * @param msg Format string for sprintf().*/ - AI_WONT_RETURN void ReportError(const char* msg,...); + AI_WONT_RETURN void ReportError(const char* msg,...) AI_WONT_RETURN_SUFFIX; // ------------------------------------------------------------------- diff --git a/include/assimp/defs.h b/include/assimp/defs.h index 1b777a5f2..aeae0778f 100644 --- a/include/assimp/defs.h +++ b/include/assimp/defs.h @@ -162,6 +162,12 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # define AI_FORCE_INLINE inline #endif // (defined _MSC_VER) +#ifdef __clang__ +# define AI_WONT_RETURN_SUFFIX __attribute__((analyzer_noreturn)) +#else +# define AI_WONT_RETURN_SUFFIX +#endif // (defined __clang__) + #ifdef __cplusplus /* No explicit 'struct' and 'enum' tags for C++, this keeps showing up * in doxydocs.