scc

simple c99 compiler
git clone git://git.simple-cc.org/scc
Log | Files | Refs | Submodules | README | LICENSE

commit f17e5e429bd294f029394d683096a5eab07a5990
parent f1e93717214682a3ed872974a92868a906290e34
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date:   Fri, 19 Nov 2021 07:57:28 +0100

cc1: Compare against EOFTOK instead of EOF

When EOF is found the lexer returns EOFTO and not EOF. This
confuccion mas making that the if was not true ever and it
generated very confusing error messages.

Diffstat:
Msrc/cmd/cc/cc1/lex.c | 2+-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/cmd/cc/cc1/lex.c b/src/cmd/cc/cc1/lex.c @@ -774,7 +774,7 @@ next(void) else yytoken = operator(); - if (yytoken == EOF) { + if (yytoken == EOFTOK) { strcpy(yytext, "<EOF>"); if (cppctx) errorp("#endif expected");