⚗️ update warning flags
This commit is contained in:
parent
bfeac776b9
commit
57dd00f410
@ -114,7 +114,6 @@ set(CLANG_CXXFLAGS "-std=c++11 \
|
|||||||
# -Wno-aggregate-return The library uses aggregate returns.
|
# -Wno-aggregate-return The library uses aggregate returns.
|
||||||
# -Wno-long-long The library uses the long long type to interface with system functions.
|
# -Wno-long-long The library uses the long long type to interface with system functions.
|
||||||
# -Wno-namespaces The library uses namespaces.
|
# -Wno-namespaces The library uses namespaces.
|
||||||
# -Wno-noexcept
|
|
||||||
# -Wno-padded We do not care about padding warnings.
|
# -Wno-padded We do not care about padding warnings.
|
||||||
# -Wno-system-headers We do not care about warnings in system headers.
|
# -Wno-system-headers We do not care about warnings in system headers.
|
||||||
# -Wno-templates The library uses templates.
|
# -Wno-templates The library uses templates.
|
||||||
|
|||||||
@ -38,9 +38,9 @@
|
|||||||
|
|
||||||
// disable documentation warnings on clang
|
// disable documentation warnings on clang
|
||||||
#if defined(__clang__)
|
#if defined(__clang__)
|
||||||
#pragma GCC diagnostic push
|
#pragma clang diagnostic push
|
||||||
#pragma GCC diagnostic ignored "-Wdocumentation"
|
#pragma clang diagnostic ignored "-Wdocumentation"
|
||||||
#pragma GCC diagnostic ignored "-Wdocumentation-unknown-command"
|
#pragma clang diagnostic ignored "-Wdocumentation-unknown-command"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// allow to disable exceptions
|
// allow to disable exceptions
|
||||||
|
|||||||
@ -1,8 +1,8 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
// restore GCC/clang diagnostic settings
|
// restore clang diagnostic settings
|
||||||
#if defined(__clang__)
|
#if defined(__clang__)
|
||||||
#pragma GCC diagnostic pop
|
#pragma clang diagnostic pop
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// clean up
|
// clean up
|
||||||
|
|||||||
@ -2250,9 +2250,9 @@ JSON_HEDLEY_DIAGNOSTIC_POP
|
|||||||
|
|
||||||
// disable documentation warnings on clang
|
// disable documentation warnings on clang
|
||||||
#if defined(__clang__)
|
#if defined(__clang__)
|
||||||
#pragma GCC diagnostic push
|
#pragma clang diagnostic push
|
||||||
#pragma GCC diagnostic ignored "-Wdocumentation"
|
#pragma clang diagnostic ignored "-Wdocumentation"
|
||||||
#pragma GCC diagnostic ignored "-Wdocumentation-unknown-command"
|
#pragma clang diagnostic ignored "-Wdocumentation-unknown-command"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// allow to disable exceptions
|
// allow to disable exceptions
|
||||||
@ -26424,9 +26424,9 @@ inline nlohmann::json::json_pointer operator "" _json_pointer(const char* s, std
|
|||||||
// #include <nlohmann/detail/macro_unscope.hpp>
|
// #include <nlohmann/detail/macro_unscope.hpp>
|
||||||
|
|
||||||
|
|
||||||
// restore GCC/clang diagnostic settings
|
// restore clang diagnostic settings
|
||||||
#if defined(__clang__)
|
#if defined(__clang__)
|
||||||
#pragma GCC diagnostic pop
|
#pragma clang diagnostic pop
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// clean up
|
// clean up
|
||||||
|
|||||||
@ -27,13 +27,14 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|||||||
SOFTWARE.
|
SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// avoid warning when assert does not abort
|
|
||||||
#if defined(__GNUC__)
|
|
||||||
#pragma GCC diagnostic ignored "-Wstrict-overflow"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "doctest_compatibility.h"
|
#include "doctest_compatibility.h"
|
||||||
|
|
||||||
|
// avoid warning when assert does not abort
|
||||||
|
DOCTEST_GCC_SUPPRESS_WARNING_PUSH
|
||||||
|
DOCTEST_GCC_SUPPRESS_WARNING("-Wstrict-overflow")
|
||||||
|
DOCTEST_CLANG_SUPPRESS_WARNING_PUSH
|
||||||
|
DOCTEST_CLANG_SUPPRESS_WARNING("-Wstrict-overflow")
|
||||||
|
|
||||||
/// global variable to record side effect of assert calls
|
/// global variable to record side effect of assert calls
|
||||||
static int assert_counter;
|
static int assert_counter;
|
||||||
|
|
||||||
@ -63,3 +64,6 @@ TEST_CASE("JSON_ASSERT(x)")
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
DOCTEST_GCC_SUPPRESS_WARNING_POP
|
||||||
|
DOCTEST_CLANG_SUPPRESS_WARNING_POP
|
||||||
|
|||||||
@ -29,6 +29,7 @@ SOFTWARE.
|
|||||||
|
|
||||||
#include "doctest_compatibility.h"
|
#include "doctest_compatibility.h"
|
||||||
|
|
||||||
|
// disable -Wnoexcept as exceptions are switched off for this test suite
|
||||||
DOCTEST_GCC_SUPPRESS_WARNING_PUSH
|
DOCTEST_GCC_SUPPRESS_WARNING_PUSH
|
||||||
DOCTEST_GCC_SUPPRESS_WARNING("-Wnoexcept")
|
DOCTEST_GCC_SUPPRESS_WARNING("-Wnoexcept")
|
||||||
|
|
||||||
|
|||||||
@ -358,10 +358,10 @@ TEST_CASE("JSON pointers")
|
|||||||
CHECK_THROWS_WITH(j_const[jp] == 1, throw_msg.c_str());
|
CHECK_THROWS_WITH(j_const[jp] == 1, throw_msg.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(_MSC_VER)
|
// on some machines, the check below is not constant
|
||||||
#pragma warning (push)
|
DOCTEST_MSVC_SUPPRESS_WARNING_PUSH
|
||||||
#pragma warning (disable : 4127) // on some machines, the check below is not constant
|
DOCTEST_MSVC_SUPPRESS_WARNING(4127)
|
||||||
#endif
|
|
||||||
if (sizeof(typename json::size_type) < sizeof(unsigned long long))
|
if (sizeof(typename json::size_type) < sizeof(unsigned long long))
|
||||||
{
|
{
|
||||||
auto size_type_max_uul = static_cast<unsigned long long>((std::numeric_limits<json::size_type>::max)());
|
auto size_type_max_uul = static_cast<unsigned long long>((std::numeric_limits<json::size_type>::max)());
|
||||||
@ -375,9 +375,7 @@ TEST_CASE("JSON pointers")
|
|||||||
CHECK_THROWS_WITH(j_const[jp] == 1, throw_msg.c_str());
|
CHECK_THROWS_WITH(j_const[jp] == 1, throw_msg.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(_MSC_VER)
|
DOCTEST_MSVC_SUPPRESS_WARNING_POP
|
||||||
#pragma warning (pop)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
CHECK_THROWS_AS(j.at("/one"_json_pointer) = 1, json::parse_error&);
|
CHECK_THROWS_AS(j.at("/one"_json_pointer) = 1, json::parse_error&);
|
||||||
CHECK_THROWS_WITH(j.at("/one"_json_pointer) = 1,
|
CHECK_THROWS_WITH(j.at("/one"_json_pointer) = 1,
|
||||||
|
|||||||
@ -29,6 +29,7 @@ SOFTWARE.
|
|||||||
|
|
||||||
#include "doctest_compatibility.h"
|
#include "doctest_compatibility.h"
|
||||||
|
|
||||||
|
// disable -Wnoexcept due to struct pod_bis
|
||||||
DOCTEST_GCC_SUPPRESS_WARNING_PUSH
|
DOCTEST_GCC_SUPPRESS_WARNING_PUSH
|
||||||
DOCTEST_GCC_SUPPRESS_WARNING("-Wnoexcept")
|
DOCTEST_GCC_SUPPRESS_WARNING("-Wnoexcept")
|
||||||
|
|
||||||
|
|||||||
@ -42,10 +42,9 @@ using nlohmann::json;
|
|||||||
#include <sstream>
|
#include <sstream>
|
||||||
#include <iomanip>
|
#include <iomanip>
|
||||||
|
|
||||||
#if defined(_MSC_VER)
|
// local variable is initialized but not referenced
|
||||||
#pragma warning (push)
|
DOCTEST_MSVC_SUPPRESS_WARNING_PUSH
|
||||||
#pragma warning (disable : 4189) // local variable is initialized but not referenced
|
DOCTEST_MSVC_SUPPRESS_WARNING(4189)
|
||||||
#endif
|
|
||||||
|
|
||||||
TEST_CASE("README" * doctest::skip())
|
TEST_CASE("README" * doctest::skip())
|
||||||
{
|
{
|
||||||
@ -321,6 +320,4 @@ TEST_CASE("README" * doctest::skip())
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(_MSC_VER)
|
DOCTEST_MSVC_SUPPRESS_WARNING_POP
|
||||||
#pragma warning (pop)
|
|
||||||
#endif
|
|
||||||
|
|||||||
@ -29,6 +29,7 @@ SOFTWARE.
|
|||||||
|
|
||||||
#include "doctest_compatibility.h"
|
#include "doctest_compatibility.h"
|
||||||
|
|
||||||
|
// disable -Wnoexcept due to class Evil
|
||||||
DOCTEST_GCC_SUPPRESS_WARNING_PUSH
|
DOCTEST_GCC_SUPPRESS_WARNING_PUSH
|
||||||
DOCTEST_GCC_SUPPRESS_WARNING("-Wnoexcept")
|
DOCTEST_GCC_SUPPRESS_WARNING("-Wnoexcept")
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user