[[/* Infix notation calculator--calc */
%{
+#include <config.h>
#include <stdio.h>
-#include <stdlib.h>
+
+#if STDC_HEADERS
+# include <stdlib.h>
+# include <string.h>
+#else
+char *strcat(char *dest, const char *src);
+#endif
#include <ctype.h>
]$4[
static int power (int base, int exponent);
static void yyerror (const char *s);
static int yylex (void);
+static int yygetc (void);
+static void yyungetc (int c);
+
extern void perror (const char *s);
%}
}
static int
-yygetc ()
+yygetc (void)
{
int res = getc (yyin);
#if YYLSP_NEEDED
[_AT_DATA_CALC_Y($[1], $[2], $[3],
[ifelse(regexp([$1], [--yyerror-verbose]),
[-1], [],
- [[#define YYERROR_VERBOSE]])])])
+ [[#define YYERROR_VERBOSE 1]])])])
# Specify the output files to avoid problems on different file systems.
AT_CHECK([bison calc.y -o calc.c patsubst([$1], [--yyerror-verbose])],
[0], [], [])
-AT_CHECK([$CC $CFLAGS calc.c -o calc], 0, [], [])
+AT_CHECK([$CC $CFLAGS $CPPFLAGS calc.c -o calc], 0, [], [])
# Test the priorities.
_AT_CHECK_CALC([$1],
# ------------------ #
AT_CHECK_CALC()
-# This one is very suspicious. The test fails, but it might be normal.
-AT_CHECK_CALC([--raw])
AT_CHECK_CALC([--defines])
AT_CHECK_CALC([--locations])