From: Akim Demaille Date: Tue, 19 Sep 2000 12:37:58 +0000 (+0000) Subject: * tests/calc.m4 (calc.y): Do not assign to stdin, as it's not X-Git-Tag: BISON-1_28b~132 X-Git-Url: https://git.saurik.com/bison.git/commitdiff_plain/05a1d24b1efccc9facc61b521e62902d390bb869?ds=inline * tests/calc.m4 (calc.y): Do not assign to stdin, as it's not portable. --- diff --git a/ChangeLog b/ChangeLog index cd4a7804..064924da 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2000-09-19 Akim Demaille + + * tests/calc.m4 (calc.y): Do not assign to stdin, as it's not + portable. + 2000-09-18 Akim Demaille * configure.in: Append WARNING_CFLAGS to CFLAGS. diff --git a/tests/calc.m4 b/tests/calc.m4 index 9b57a85d..9f0942d7 100644 --- a/tests/calc.m4 +++ b/tests/calc.m4 @@ -54,11 +54,13 @@ exp: NUM { $$ = $1; } | '(' exp ')' { $$ = $2; } ; %% +FILE *yyin = stdin; + int main (int argn, const char **argv) { if (argn == 2) - stdin = fopen (argv[1], "r"); + yyin = fopen (argv[1], "r"); if (!stdin) { perror (argv[1]); @@ -110,13 +112,13 @@ yylex () int c; /* Skip white space. */ - while ((c = getchar ()) == ' ' || c == '\t') + while ((c = getc (yyin)) == ' ' || c == '\t') ; /* process numbers */ if (c == '.' || isdigit (c)) { - ungetc (c, stdin); - yylval = read_signed_integer (stdin); + ungetc (c, yyin); + yylval = read_signed_integer (yyin); return NUM; } /* Return end-of-file. */