+2000-09-19 Akim Demaille <akim@epita.fr>
+
+ * tests/calc.m4 (calc.y): Do not assign to stdin, as it's not
+ portable.
+
2000-09-18 Akim Demaille <akim@epita.fr>
* configure.in: Append WARNING_CFLAGS to CFLAGS.
| '(' 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]);
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. */