scc

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

commit a004412434813b0500807d46d09c2d0cef13205d
parent 989b26202e9264b37237371f85a19630ec4f1b0a
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");