[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug binutils/20958] New: yywrap in binutils/syslex.l and ld/ldlex.l
From: |
dilyan.palauzov at aegee dot org |
Subject: |
[Bug binutils/20958] New: yywrap in binutils/syslex.l and ld/ldlex.l |
Date: |
Sun, 11 Dec 2016 21:12:27 +0000 |
https://sourceware.org/bugzilla/show_bug.cgi?id=20958
Bug ID: 20958
Summary: yywrap in binutils/syslex.l and ld/ldlex.l
Product: binutils
Version: 2.28 (HEAD)
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: binutils
Assignee: unassigned at sourceware dot org
Reporter: dilyan.palauzov at aegee dot org
Target Milestone: ---
The most recent flex v2.6.2-19-g6bea32e generates code like
#define yywrap yywrap
#define yyalloc yyalloc
and from that moment on 'yywrap' is defined, hence
#ifndef yywrap
static int yywrap (void) { return 1;}
#endif
is discarded and the compilation fails.
This patch helps (but does not consider the same effect in binutils/(arlex.l,
deflex.l, gas/config/bfin-lex.l, gas/itbl-lex.l and gdb/ada-lex.l. I find also
#ifdef yywrap
extern int yywrap (void);
#endif in ld/ldlex.h is unnecessary.
diff --git a/binutils/syslex.l b/binutils/syslex.l
index 836a64cf93..25be30305e 100644
--- a/binutils/syslex.l
+++ b/binutils/syslex.l
@@ -1,4 +1,4 @@
-%option noinput nounput
+%option noinput nounput noyywrap
%{
/* Copyright (C) 2001-2016 Free Software Foundation, Inc.
@@ -36,10 +36,6 @@
#define YY_NO_UNPUT
#endif
-#ifndef yywrap
-static int yywrap (void) { return 1; }
-#endif
-
extern int yylex (void);
%}
%%
diff --git a/ld/ldlex.l b/ld/ldlex.l
index cd21c58e3d..2b229cfcd6 100644
--- a/ld/ldlex.l
+++ b/ld/ldlex.l
@@ -1,4 +1,4 @@
-%option nounput
+%option nounput noyywrap
%{
@@ -87,9 +87,6 @@ static void lex_warn_invalid (char *where, char *what);
#define RTOKEN(x) { yylval.token = x; return x; }
/* Some versions of flex want this. */
-#ifndef yywrap
-int yywrap (void) { return 1; }
-#endif
%}
%a 4000
--
You are receiving this mail because:
You are on the CC list for the bug.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Bug binutils/20958] New: yywrap in binutils/syslex.l and ld/ldlex.l,
dilyan.palauzov at aegee dot org <=