We now pass the --header=... option to flex. This causes it to
generate a header file describing the flex interface. We #include
this almost everywhere we #include conffile_internal.h, and that makes
the declarations of yyin and yylex in conffile_internal.h redundant so
remove them.
Note that flex generates a conffile.yy.c which also contains many of
the same declarations as in conffile.yy.h. So, unfortunately, we
should not #include conffile.yy.h in conffile.hh.c and therefore not
in conffile_internal.h either (if we want -Wredundant-decls, which we do).
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
*.o
*.d
conffile.tab.[ch]
-conffile.yy.c
+conffile.yy.[ch]
version.c
/secnet
%.c: %.y
%.yy.c: %.fl
- flex -o$@ $<
+ flex --header=$*.yy.h -o$@ $<
%.tab.c %.tab.h: %.y
bison -d -o $@ $<
# Manual dependencies section
conffile.yy.c: conffile.fl conffile.tab.c
+conffile.yy.h: conffile.yy.c
conffile.tab.c: conffile.y
# End of manual dependencies section
#include <string.h>
#include "conffile.h"
#include "conffile_internal.h"
+#include "conffile.yy.h"
#include "util.h"
#include "ipaddr.h"
#include <string.h>
#include "secnet.h"
#include "conffile_internal.h"
+#include "conffile.yy.h"
#include "util.h"
#define YYERROR_VERBOSE
#include <stdio.h>
#include "secnet.h"
-extern FILE *yyin;
-
typedef cstring_t atom_t;
/* Parse tree for configuration file */
struct p_node *r;
};
-extern int yylex(void);
extern cstring_t config_file;
extern uint32_t config_lineno;
extern int yynerrs;