]> git.saurik.com Git - bison.git/commit
bison: avoid warnings from static code analysis
authorAkim Demaille <akim@lrde.epita.fr>
Fri, 9 Jan 2015 13:21:09 +0000 (14:21 +0100)
committerAkim Demaille <akim@lrde.epita.fr>
Fri, 9 Jan 2015 14:27:59 +0000 (15:27 +0100)
commit671850a1c3e1aaac93a89fabc6d810be6a4a77fe
treecd8043aceb07a11f2871e91770263db7243c4433
parentee028dceff390a23da391900b5b7fe651cfe320c
bison: avoid warnings from static code analysis

A static analysis tool reports that some callers of symbol_list_n_get
might get NULL and not handle it properly.  This is not the case, yet
we can suppress this pattern.

Reported by Mike Sullivan.
<https://lists.gnu.org/archive/html/bug-bison/2013-12/msg00027.html>

* src/symlist.c (symbol_list_n_get): Actually it is never called
to return 0.  Enforce this postcondition via aver.
(symbol_list_n_type_name_get): Simplify accordingly.  In particular,
discards a (translated) useless error message.
* src/symlist.h: Adjust documentation.
* src/scan-code.l: Style change.
THANKS
po/POTFILES.in
src/scan-code.l
src/symlist.c
src/symlist.h