Merge pull request #66 from sherief/Robustness
Hints for Clang's static analyzer - preventing false positives.pull/69/head
commit
5f0bd28b15
|
@ -50,8 +50,8 @@ namespace Util {
|
||||||
|
|
||||||
|
|
||||||
/* DOM/Parse error reporting - does not return */
|
/* DOM/Parse error reporting - does not return */
|
||||||
void DOMError(const std::string& message, const Token& token);
|
AI_WONT_RETURN void DOMError(const std::string& message, const Token& token) AI_WONT_RETURN_SUFFIX;
|
||||||
void DOMError(const std::string& message, const Element* element = NULL);
|
AI_WONT_RETURN void DOMError(const std::string& message, const Element* element = NULL) AI_WONT_RETURN_SUFFIX;
|
||||||
|
|
||||||
// does return
|
// does return
|
||||||
void DOMWarning(const std::string& message, const Token& token);
|
void DOMWarning(const std::string& message, const Token& token);
|
||||||
|
|
|
@ -82,7 +82,7 @@ protected:
|
||||||
/** Report a validation error. This will throw an exception,
|
/** Report a validation error. This will throw an exception,
|
||||||
* control won't return.
|
* control won't return.
|
||||||
* @param msg Format string for sprintf().*/
|
* @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;
|
||||||
|
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
|
|
|
@ -162,6 +162,12 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
# define AI_FORCE_INLINE inline
|
# define AI_FORCE_INLINE inline
|
||||||
#endif // (defined _MSC_VER)
|
#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
|
#ifdef __cplusplus
|
||||||
/* No explicit 'struct' and 'enum' tags for C++, this keeps showing up
|
/* No explicit 'struct' and 'enum' tags for C++, this keeps showing up
|
||||||
* in doxydocs.
|
* in doxydocs.
|
||||||
|
|
Loading…
Reference in New Issue