lib: minor adjustments in warning suppressions

This commit is contained in:
Joao Paulo Magalhaes
2025-09-28 19:00:51 +01:00
parent e51901b754
commit 26f5fccef0
3 changed files with 9 additions and 3 deletions

View File

@@ -8,6 +8,9 @@
C4_SUPPRESS_WARNING_MSVC_PUSH
C4_SUPPRESS_WARNING_GCC_CLANG_PUSH
C4_SUPPRESS_WARNING_GCC_CLANG("-Wold-style-cast")
#if __GNUC__ >= 6
C4_SUPPRESS_WARNING_GCC("-Wnull-dereference")
#endif
namespace c4 {
namespace yml {

View File

@@ -857,7 +857,13 @@ void Tree::set_root_as_stream()
void Tree::remove_children(id_type node)
{
_RYML_CB_ASSERT(m_callbacks, get(node) != nullptr);
#if __GNUC__ >= 6
C4_SUPPRESS_WARNING_GCC_WITH_PUSH("-Wnull-dereference")
#endif
id_type ich = get(node)->m_first_child;
#if __GNUC__ >= 6
C4_SUPPRESS_WARNING_GCC_POP
#endif
while(ich != NONE)
{
remove_children(ich);
@@ -1178,7 +1184,6 @@ id_type Tree::child_pos(id_type node, id_type ch) const
#if defined(__clang__)
# pragma clang diagnostic push
# pragma GCC diagnostic ignored "-Wnull-dereference"
#elif defined(__GNUC__)
# pragma GCC diagnostic push
# if __GNUC__ >= 6

View File

@@ -785,8 +785,6 @@ public:
/** Get the location of a node from the parse used to parse this tree. */
Location location(Parser const& p, id_type node) const;
/** @} */
private:
bool _location_from_node(Parser const& p, id_type node, Location *C4_RESTRICT loc, id_type level) const;