diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2006-01-21 04:35:09 +0000 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2006-01-21 04:35:09 +0000 |
commit | 68cae94e0b4e83246787fc5a413f085513ae9160 (patch) | |
tree | 77f6942fc3fc73fe704c25eecc1a0b6b64185117 /src/system.h | |
parent | 287c78f6abb35137037a56d5e5ff9f35145f617b (diff) | |
download | bison-68cae94e0b4e83246787fc5a413f085513ae9160.tar.gz |
Be a bit more systematic about using 'abort'.
* lib/abitset.c (abitset_test): Remove ATTRIBUTE_UNUSED; not needed.
* lib/bitset.c (bitset_bytes, bitset_init, bitset_op4_cmp):
Put 'default: abort ();' before some other case, to satisfy older
pedantic compilers.
* lib/bitset_stats.c (bitset_stats_init): Likewise.
* lib/ebitset.c (ebitset_elt_find, ebitset_op3_cmp): Likewise.
* lib/lbitset.c (lbitset_elt_find, lbitset_op3_cmp): Likewise.
* src/conflicts.c (resolve_sr_conflict): Likewise.
* src/vcg.c (get_color_str, get_textmode_str, get_shape_str):
(get_decision_str, get_orientation_str, get_node_alignment_str):
(get_arrow_mode_str, get_crossing_type_str, get_view_str):
(get_linestyle_str, get_arrowstyle_str): Likewise.
* src/conflicts.c (resolve_sr_conflict):
Use a default case rather than one for the one remaining enum
value, to catch invalid enum values as well.
* src/lalr.c (set_goto_map, map_goto):
Prefer "assert (FOO);" to "if (!FOO) abort ();".
* src/nullable.c (nullable_compute, token_definitions_output):
Likewise.
* src/reader.c (packgram, reader): Likewise.
* src/state.c (transitions_to, state_new, state_reduction_find):
Likewise.
* src/symtab.c (symbol_user_token_number_set, symbol_make_alias):
(symbol_pack): Likewise.
* src/tables.c (conflict_row, pack_vector): Likewise.
* src/scan-skel.l (QPUTS): Remove unnecessary parens.
(BASE_QPUTS, "@output ".*\n): Remove unnecessary asserts.
* src/system.h: Don't include <assert.h>.
(assert): New macro.
Diffstat (limited to 'src/system.h')
-rw-r--r-- | src/system.h | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/system.h b/src/system.h index c1c45b49..d6b45eeb 100644 --- a/src/system.h +++ b/src/system.h @@ -64,8 +64,6 @@ typedef size_t uintptr_t; #endif -#include <assert.h> - #include <verify.h> #include <xalloc.h> @@ -216,6 +214,11 @@ do { \ } while (0) +/* Assertions. <assert.h>'s assertions are too heavyweight, and can + be disabled too easily, so implement it separately here. */ +#define assert(x) ((void) ((x) || (abort (), 0))) + + /*---------------------------------------------. | Debugging memory allocation (must be last). | `---------------------------------------------*/ |