diff --git a/gdb/ChangeLog b/gdb/ChangeLog index fee6332e8fc..3942b867a93 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,9 @@ +2019-10-29 Simon Marchi + + * addrmap.c: Add static assertions of type size, moved from + _initialize_addrmap. + (_initialize_addrmap): Remove. + 2019-10-29 Christian Biesinger * coffread.c (record_minimal_symbol): Update. diff --git a/gdb/addrmap.c b/gdb/addrmap.c index 6c3ed6945fb..bcdb4817042 100644 --- a/gdb/addrmap.c +++ b/gdb/addrmap.c @@ -22,6 +22,11 @@ #include "gdb_obstack.h" #include "addrmap.h" +/* Make sure splay trees can actually hold the values we want to + store in them. */ +gdb_static_assert (sizeof (splay_tree_key) >= sizeof (CORE_ADDR *)); +gdb_static_assert (sizeof (splay_tree_value) >= sizeof (void *)); + /* The "abstract class". */ @@ -587,14 +592,3 @@ addrmap_create_mutable (struct obstack *obstack) return (struct addrmap *) map; } - -/* Initialization. */ - -void -_initialize_addrmap (void) -{ - /* Make sure splay trees can actually hold the values we want to - store in them. */ - gdb_assert (sizeof (splay_tree_key) >= sizeof (CORE_ADDR *)); - gdb_assert (sizeof (splay_tree_value) >= sizeof (void *)); -}