reader: simplify the search of the start symbol

Suggested by Paul Eggert.

* src/reader.c (find_start_symbol): Don't check 'res', we know it is
not null.  That suffices to avoid the GCC warnings.
* bootstrap.conf: We don't need 'assume', which doesn't exist anyway.
This commit is contained in:
Akim Demaille
2018-08-15 21:03:47 +02:00
parent 1113522acb
commit 8bc4348cc7
2 changed files with 6 additions and 12 deletions

View File

@@ -17,7 +17,7 @@
# gnulib modules used by this package. # gnulib modules used by this package.
gnulib_modules=' gnulib_modules='
argmatch assert assume argmatch assert
calloc-posix close closeout config-h c-strcase calloc-posix close closeout config-h c-strcase
configmake configmake
dirname dirname

View File

@@ -729,17 +729,11 @@ static symbol *
find_start_symbol (void) find_start_symbol (void)
{ {
symbol_list *res = grammar; symbol_list *res = grammar;
for (; /* Skip all the possible dummy rules of the first rule. */
res && symbol_is_dummy (res->content.sym); for (; symbol_is_dummy (res->content.sym); res = res->next)
res = res->next) /* Skip the LHS, and then all the RHS of the dummy rule. */
{ for (res = res->next; res->content.sym; res = res->next)
for (res = res->next; continue;
res && res->content.sym;
res = res->next)
continue;
assume (res);
}
assume (res);
return res->content.sym; return res->content.sym;
} }