From: Paul Eggert Date: Tue, 27 Sep 2005 06:08:27 +0000 (+0000) Subject: * bootstrap (gnulib_modules): Add verify. X-Git-Tag: v2.3b~629 X-Git-Url: https://git.saurik.com/bison.git/commitdiff_plain/8a6f72f3d7b273fada66d1af89b7f95cb578810d * bootstrap (gnulib_modules): Add verify. * lib/.cvsignore: Add verify.h. * src/getargs.c: Use ARGMATCH_VERIFY rather than verify. * src/system.h (verify): Remove. Include verify.h instead. * src/tables.c (tables_generate): Use new API for 'verify'. --- diff --git a/ChangeLog b/ChangeLog index 83e36b09..3ee2f4db 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2005-09-26 Paul Eggert + + * bootstrap (gnulib_modules): Add verify. + * lib/.cvsignore: Add verify.h. + * src/getargs.c: Use ARGMATCH_VERIFY rather than verify. + * src/system.h (verify): Remove. + Include verify.h instead. + * src/tables.c (tables_generate): Use new API for 'verify'. + 2005-09-21 Paul Eggert * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Do not use diff --git a/bootstrap b/bootstrap index 017517fc..e1e0caa4 100755 --- a/bootstrap +++ b/bootstrap @@ -109,6 +109,7 @@ stdbool stdio-safer stpcpy unistd-safer +verify xalloc xalloc-die xstrndup diff --git a/lib/.cvsignore b/lib/.cvsignore index 4d1bda4b..3f834a0b 100644 --- a/lib/.cvsignore +++ b/lib/.cvsignore @@ -54,6 +54,7 @@ strnlen.h unistd--.h unistd-safer.h unlocked-io.h +verify.h xalloc-die.c xalloc.h xmalloc.c diff --git a/src/getargs.c b/src/getargs.c index 0170f8e3..2b6fa0fb 100644 --- a/src/getargs.c +++ b/src/getargs.c @@ -103,11 +103,11 @@ static const int trace_types[] = trace_all }; +ARGMATCH_VERIFY (trace_args, trace_types); static void trace_argmatch (char *args) { - verify (trace_constraint, ARGMATCH_CONSTRAINT (trace_args, trace_types)); if (args) { args = strtok (args, ","); @@ -156,11 +156,11 @@ static const int report_types[] = report_all }; +ARGMATCH_VERIFY (report_args, report_types); static void report_argmatch (char *args) { - verify (report_constraint, ARGMATCH_CONSTRAINT (report_args, report_types)); args = strtok (args, ","); do { diff --git a/src/system.h b/src/system.h index 755a75cb..feb851d6 100644 --- a/src/system.h +++ b/src/system.h @@ -30,9 +30,6 @@ #include #include -/* Verify a requirement at compile-time (unlike assert, which is runtime). */ -#define verify(name, assertion) struct name {char name[(assertion) ? 1 : -1];} - #if HAVE_SYS_TYPES_H # include #endif @@ -54,6 +51,7 @@ typedef size_t uintptr_t; #endif +#include #include diff --git a/src/tables.c b/src/tables.c index 4e99f4ad..02d10f15 100644 --- a/src/tables.c +++ b/src/tables.c @@ -810,9 +810,8 @@ tables_generate (void) /* This is a poor way to make sure the sizes are properly correlated. In particular the signedness is not taken into account. But it's not useless. */ - verify (sizes_are_properly_correlated, - (sizeof nstates <= sizeof nvectors - && sizeof nvars <= sizeof nvectors)); + verify (sizeof nstates <= sizeof nvectors + && sizeof nvars <= sizeof nvectors); nvectors = state_number_as_int (nstates) + nvars;