summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorEric Blake <ebb9@byu.net>2009-08-20 16:54:07 -0600
committerEric Blake <ebb9@byu.net>2009-08-20 16:54:07 -0600
commitb0778bdd0c2c7d5136f46ffe5c00b4c9153d5169 (patch)
tree80cdddf368988cbc73262be1316f34d0ef66f90f /src
parentd8911864c25f5521b28fcf9e17e88436c17c59bd (diff)
downloadbison-b0778bdd0c2c7d5136f46ffe5c00b4c9153d5169.tar.gz
Make previous patch more robust.
* src/output.c (ARRAY_CARDINALITY): New macro, copied from argmatch.h. (output_skeleton): Use it. Suggested by Akim Demaille. Signed-off-by: Eric Blake <ebb9@byu.net> (cherry picked from commit 1266b636740f0c6719d8cc11a5d569084fa37009)
Diffstat (limited to 'src')
-rw-r--r--src/output.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/output.c b/src/output.c
index f739f0e9..23cd8ffa 100644
--- a/src/output.c
+++ b/src/output.c
@@ -21,6 +21,7 @@
#include <config.h>
#include "system.h"
+#include <assert.h>
#include <configmake.h>
#include <error.h>
#include <get-errno.h>
@@ -40,6 +41,7 @@
#include "symtab.h"
#include "tables.h"
+# define ARRAY_CARDINALITY(Array) (sizeof (Array) / sizeof *(Array))
static struct obstack format_obstack;
@@ -635,6 +637,7 @@ output_skeleton (void)
argv[i++] = full_m4bison;
argv[i++] = full_skeleton;
argv[i++] = NULL;
+ assert (i <= ARRAY_CARDINALITY (argv));
}
init_subpipe ();