diff options
Diffstat (limited to 'tools')
| -rwxr-xr-x | tools/frr-reload.py | 6 | ||||
| -rw-r--r-- | tools/gcc-plugins/frr-format.c | 17 |
2 files changed, 22 insertions, 1 deletions
diff --git a/tools/frr-reload.py b/tools/frr-reload.py index 951383beb2..0de6c1c2e3 100755 --- a/tools/frr-reload.py +++ b/tools/frr-reload.py @@ -1301,6 +1301,12 @@ def compare_context_objects(newconf, running): ): continue + # same thing for a pseudowire sub-context inside an l2vpn context + elif (len(running_ctx_keys) > 1 and running_ctx_keys[0].startswith('l2vpn') and + running_ctx_keys[1].startswith('member pseudowire') and + (running_ctx_keys[:1], None) in lines_to_del): + continue + # Non-global context elif running_ctx_keys and not any( "address-family" in key for key in running_ctx_keys diff --git a/tools/gcc-plugins/frr-format.c b/tools/gcc-plugins/frr-format.c index be56517171..6d91d2cdcd 100644 --- a/tools/gcc-plugins/frr-format.c +++ b/tools/gcc-plugins/frr-format.c @@ -2729,6 +2729,16 @@ tree type_normalize (tree type, tree *cousin, tree target = NULL) return type; } +/* gcc-10 asserts when you give a TYPE_DECL instead of the actual TYPE */ +static tree +decl_deref(tree typ) +{ + while (TREE_CODE (typ) == TYPE_DECL) + typ = DECL_ORIGINAL_TYPE (typ); + + return typ; +} + static void check_format_types (const substring_loc &fmt_loc, format_wanted_type *types, const format_kind_info *fki, @@ -2750,6 +2760,8 @@ check_format_types (const substring_loc &fmt_loc, wanted_type = types->wanted_type; arg_num = types->arg_num; + wanted_type = decl_deref(wanted_type); + /* The following should not occur here. */ gcc_assert (wanted_type); gcc_assert (wanted_type != void_type_node || types->pointer_count); @@ -2873,7 +2885,7 @@ check_format_types (const substring_loc &fmt_loc, || cur_type == signed_char_type_node || cur_type == unsigned_char_type_node); - int compat = lang_hooks.types_compatible_p (wanted_type, cur_type); + int compat = lang_hooks.types_compatible_p (decl_deref (wanted_type), decl_deref (cur_type)); /* Check the type of the "real" argument, if there's a type we want. */ if ((TREE_CODE (wanted_type) != INTEGER_TYPE || types->pointer_count) && compat) @@ -3180,6 +3192,9 @@ matching_type_p (tree spec_type, tree arg_type) gcc_assert (spec_type); gcc_assert (arg_type); + spec_type = decl_deref (spec_type); + arg_type = decl_deref (arg_type); + /* If any of the types requires structural equality, we can't compare their canonical types. */ if (TYPE_STRUCTURAL_EQUALITY_P (spec_type) |
