[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: bison c++ compile
From: |
Akim Demaille |
Subject: |
Re: bison c++ compile |
Date: |
Fri, 20 Jan 2006 15:14:03 +0100 |
User-agent: |
Gnus/5.110004 (No Gnus v0.4) Emacs/21.4 (gnu/linux) |
>>> "Paul" == Paul Eggert <address@hidden> writes:
> @@ -37,11 +37,11 @@ static bitset_bindex
> abitset_resize (bitset src ATTRIBUTE_UNUSED,
> bitset_bindex size ATTRIBUTE_UNUSED)
> {
> - if (BITSET_SIZE_ (src) == size)
> - return size;
> -
> /* These bitsets have a fixed size. */
> - abort ();
> + if (BITSET_SIZE_ (src) != size)
> + abort ();
> +
> + return size;
> }
> @@ -58,10 +59,13 @@ state *
> transitions_to (transitions *shifts, symbol_number sym)
> {
> int j;
> - for (j = 0; j < shifts->num; j++)
> - if (TRANSITION_SYMBOL (shifts, j) == sym)
> - return shifts->states[j];
> - abort ();
> + for (j = 0; ; j++)
> + {
> + if (shifts->num <= j)
> + abort ();
> + if (TRANSITION_SYMBOL (shifts, j) == sym)
> + return shifts->states[j];
> + }
> }
Any reason not to use assert in these? ISTR that the GCS don't
recommend it, but still, that's cuter.