aboutsummaryrefslogtreecommitdiff
path: root/gdb/mi
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2011-11-22 21:18:38 +0000
committerTom Tromey <tromey@redhat.com>2011-11-22 21:18:38 +0000
commitf5afdc187dae0c7472d001381b579348b5d36316 (patch)
tree35b11836bce8a2e5e9cb56a255464ca80cd79c03 /gdb/mi
parentfc87b9e82571ba0015d5d3802cf714ae7c666ee6 (diff)
downloadgdb-f5afdc187dae0c7472d001381b579348b5d36316.zip
gdb-f5afdc187dae0c7472d001381b579348b5d36316.tar.gz
gdb-f5afdc187dae0c7472d001381b579348b5d36316.tar.bz2
* mi/mi-common.c (_initialize_gdb_mi_common): Remove.
Use static_assert to check the size of async_reason_string_lookup. * common/gdb_assert.h (static_assert): New macro.
Diffstat (limited to 'gdb/mi')
-rw-r--r--gdb/mi/mi-common.c14
1 files changed, 3 insertions, 11 deletions
diff --git a/gdb/mi/mi-common.c b/gdb/mi/mi-common.c
index ab126f6..e7dd3c4 100644
--- a/gdb/mi/mi-common.c
+++ b/gdb/mi/mi-common.c
@@ -18,6 +18,7 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
+#include "gdb_assert.h"
#include "mi-common.h"
static const char * const async_reason_string_lookup[] =
@@ -37,19 +38,10 @@ static const char * const async_reason_string_lookup[] =
NULL
};
+static_assert (ARRAY_SIZE (async_reason_string_lookup) == EXEC_ASYNC_LAST + 1);
+
const char *
async_reason_lookup (enum async_reply_reason reason)
{
return async_reason_string_lookup[reason];
}
-
-/* Provide a prototype to silence -Wmissing-prototypes. */
-extern initialize_file_ftype _initialize_gdb_mi_common;
-
-void
-_initialize_gdb_mi_common (void)
-{
- if (ARRAY_SIZE (async_reason_string_lookup) != EXEC_ASYNC_LAST + 1)
- internal_error (__FILE__, __LINE__,
- _("async_reason_string_lookup is inconsistent"));
-}