+2006-08-10 Joel E. Denny <jdenny@ces.clemson.edu>
+
+ Clean up scanners a bit.
+ * src/flex-scanner.h (FLEX_NO_OBSTACK): New macro that blocks obstack
+ definitions so gcc won't warn when obstack_for_string is unused.
+ * src/scan-code.l: config.h and system.h are already #include'd by
+ scan-code-c.c, so get rid of them here.
+ * src/scan-gram.l: Likewise.
+ * src/scan-skel.l: Likewise, and use flex-scanner.h without obstack
+ definitions rather than duplicating the rest of it.
+ * src/scan-gram-c.c, scan-skel-c.c: #include "system.h".
+
2006-08-09 Joel E. Denny <jdenny@ces.clemson.edu>
Suppress signed/unsigned comparison warnings for yycheck.
-/* Common parts between scan-code.l and scan-gram.l.
+/* Common parts between scan-code.l, scan-gram.l, and scan-skel.l.
Copyright (C) 2006 Free Software Foundation, Inc.
STRING_FINISH also stores this string in LAST_STRING, which can be
used, and which is used by STRING_FREE to free the last string. */
+#ifndef FLEX_NO_OBSTACK
+
static struct obstack obstack_for_string;
#define STRING_GROW \
#define STRING_FREE \
obstack_free (&obstack_for_string, last_string)
+
+#endif
%option prefix="code_" outfile="lex.yy.c"
%{
-#include <config.h>
-#include "system.h"
-
/* Work around a bug in flex 2.5.31. See Debian bug 333231
<http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=333231>. */
#undef code_wrap
#define code_wrap() 1
#define FLEX_PREFIX(Id) code_ ## Id
-#include "complain.h"
#include "flex-scanner.h"
+
+#include "complain.h"
#include "reader.h"
#include "getargs.h"
#include <assert.h>
#include <config.h>
+#include "system.h"
#include "scan-gram.c"
%option prefix="gram_" outfile="lex.yy.c"
%{
-#include <config.h>
-#include "system.h"
-
/* Work around a bug in flex 2.5.31. See Debian bug 333231
<http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=333231>. */
#undef gram_wrap
#include <config.h>
+#include "system.h"
#include "scan-skel.c"
#undef skel_wrap
#define skel_wrap() 1
-#include "system.h"
+#define FLEX_NO_OBSTACK
+#define FLEX_PREFIX(Id) skel_ ## Id
+#include "flex-scanner.h"
#include <dirname.h>
#include <error.h>
#include "files.h"
#include "scan-skel.h"
-/* Pacify "gcc -Wmissing-prototypes" when flex 2.5.31 is used. */
int skel_lex (void);
-int skel_get_lineno (void);
-FILE *skel_get_in (void);
-FILE *skel_get_out (void);
-int skel_get_leng (void);
-char *skel_get_text (void);
-void skel_set_lineno (int);
-void skel_set_in (FILE *);
-void skel_set_out (FILE *);
-int skel_get_debug (void);
-void skel_set_debug (int);
-int skel_lex_destroy (void);
#define QPUTS(String) \
fputs (quotearg_style (c_quoting_style, String), yyout)