This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
PATCH: improve gengtype-lex.l warning fix
- From: Ben Elliston <bje at au1 dot ibm dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Fri, 20 Nov 2009 09:43:45 +1100
- Subject: PATCH: improve gengtype-lex.l warning fix
In January, I proposed a patch to gengtype-lex.l that would silence this
warning when building gengtype:
gengtype-lex.c:1908: warning: `input' defined but not used
The patch that was approved is described here:
http://gcc.gnu.org/ml/gcc-patches/2009-01/msg00178.html
While addressing similar warnings in binutils this week, I fixed them a
different way -- using flex %option directives. Now that I think about
it, this is a more correct fix and want to adjust the original GCC
patch. This particular option directive is supported by flex 2.5.4a
(released in 1997).
Tested by running make gengtype-lex.c with and without the patch and
comparing the flex output. Okay for mainline?
2009-11-20 Ben Elliston <bje@au.ibm.com>
* gengtype-lex.l: Enable noinput flex option.
(YY_NO_INPUT): Remove define.
Index: gengtype-lex.l
===================================================================
--- gengtype-lex.l (revision 154344)
+++ gengtype-lex.l (working copy)
@@ -19,6 +19,8 @@ You should have received a copy of the G
along with GCC; see the file COPYING3. If not see
<http://www.gnu.org/licenses/>. */
+%option noinput
+
%{
#include "bconfig.h"
#include "system.h"
@@ -28,7 +30,6 @@ along with GCC; see the file COPYING3.
#include "gengtype.h"
-#define YY_NO_INPUT
#define YY_DECL int yylex (const char **yylval)
#define yyterminate() return EOF_TOKEN