File tree Expand file tree Collapse file tree 1 file changed +15
-2
lines changed
Expand file tree Collapse file tree 1 file changed +15
-2
lines changed Original file line number Diff line number Diff line change 2929#pragma warning(disable : 4251)
3030#endif // if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING)
3131
32+ // Conditional NORETURN attribute on the throw functions would:
33+ // a) suppress false positives from static code analysis
34+ // b) possibly improve optimization opportunities.
35+ #if !defined(JSONCPP_NORETURN)
36+ # if defined(_MSC_VER)
37+ # define JSONCPP_NORETURN __declspec (noreturn)
38+ # elif defined(__GNUC__)
39+ # define JSONCPP_NORETURN __attribute__ ((__noreturn__))
40+ # else
41+ # define JSONCPP_NORETURN
42+ # endif
43+ #endif
44+
3245/* * \brief JSON (JavaScript Object Notation).
3346 */
3447namespace Json {
@@ -69,9 +82,9 @@ class JSON_API LogicError : public Exception {
6982};
7083
7184// / used internally
72- void throwRuntimeError (std::string const & msg);
85+ JSONCPP_NORETURN void throwRuntimeError (std::string const & msg);
7386// / used internally
74- void throwLogicError (std::string const & msg);
87+ JSONCPP_NORETURN void throwLogicError (std::string const & msg);
7588
7689/* * \brief Type of the value held by a Value object.
7790 */
You can’t perform that action at this time.
0 commit comments