bison-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] Fix a --enable-gcc-warnings problem.


From: Joel E. Denny
Subject: Re: [PATCH] Fix a --enable-gcc-warnings problem.
Date: Sat, 1 Aug 2009 18:37:32 -0400 (EDT)
User-agent: Alpine 1.00 (DEB 882 2007-12-20)

On Sat, 1 Aug 2009, Alex Rozenman wrote:

> > "src/scan-code.c:1759: warning: 'input' defined but not used"
> >
> > I'm not seeing that one.  What are your versions of gcc and flex?
> >
> 
> I am using Fedora 11 installation:
> 
> $ flex --version
> flex 2.5.35
> $ gcc --version
> gcc (GCC) 4.4.0 20090506 (Red Hat 4.4.0-4)

Thanks.

I pushed the following to branch-2.4.2, branch-2.5, and master to fix 
that.  The fix doesn't work with Flex 2.5.4.  However, I no longer have a 
system that installs Flex 2.5.4 by default, so I don't want to bother even 
testing with it ever again.  In the past, I believe other Bison developers 
have been happy to use a recent Flex too.

>From 42f8609bbd033edf6cca102ca080eade94ed08ef Mon Sep 17 00:00:00 2001
From: Joel E. Denny <address@hidden>
Date: Sat, 1 Aug 2009 17:51:34 -0400
Subject: [PATCH] Pacify "gcc -Wunused" for the input function from Flex.

Reported by Alex Rozenman.  This warning shows up with gcc-4.3.0
and later.
* src/scan-code.l: Add "%option noinput", which I cannot find in
the Flex manual, but which Flex has supported since at least as
far back as 2.5.4.  However, if any of our developers still use
Flex 2.5.4, they'll need to stop configuring with
--enable-gcc-warnings because "%option noinput" didn't work
correctly until Flex 2.5.6.
* src/scan-gram.l: Likewise.
* src/scan-skel.l: Likewise.
---
 ChangeLog       |   14 ++++++++++++++
 src/scan-code.l |    2 +-
 src/scan-gram.l |    2 +-
 src/scan-skel.l |    2 +-
 4 files changed, 17 insertions(+), 3 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index bf0f174..3c0ba08 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,17 @@
+2009-08-01  Joel E. Denny  <address@hidden>
+
+       Pacify "gcc -Wunused" for the input function from Flex.
+       Reported by Alex Rozenman.  This warning shows up with gcc-4.3.0
+       and later.
+       * src/scan-code.l: Add "%option noinput", which I cannot find in
+       the Flex manual, but which Flex has supported since at least as
+       far back as 2.5.4.  However, if any of our developers still use
+       Flex 2.5.4, they'll need to stop configuring with
+       --enable-gcc-warnings because "%option noinput" didn't work
+       correctly until Flex 2.5.6.
+       * src/scan-gram.l: Likewise.
+       * src/scan-skel.l: Likewise.
+
 2009-06-29  Akim Demaille  <address@hidden>
 
        build: avoid concurrent extraction of calc++.
diff --git a/src/scan-code.l b/src/scan-code.l
index 13a78c2..d357f09 100644
--- a/src/scan-code.l
+++ b/src/scan-code.l
@@ -17,7 +17,7 @@
    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
-%option debug nodefault nounput noyywrap never-interactive
+%option debug nodefault noinput nounput noyywrap never-interactive
 %option prefix="code_" outfile="lex.yy.c"
 
 %{
diff --git a/src/scan-gram.l b/src/scan-gram.l
index 697f52f..13308bb 100644
--- a/src/scan-gram.l
+++ b/src/scan-gram.l
@@ -18,7 +18,7 @@
    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
-%option debug nodefault nounput noyywrap never-interactive
+%option debug nodefault noinput nounput noyywrap never-interactive
 %option prefix="gram_" outfile="lex.yy.c"
 
 %{
diff --git a/src/scan-skel.l b/src/scan-skel.l
index 6ef5351..6841b4a 100644
--- a/src/scan-skel.l
+++ b/src/scan-skel.l
@@ -18,7 +18,7 @@
    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
-%option nodefault noyywrap nounput never-interactive debug
+%option nodefault noyywrap noinput nounput never-interactive debug
 %option prefix="skel_" outfile="lex.yy.c"
 
 %{
-- 
1.5.4.3







reply via email to

[Prev in Thread] Current Thread [Next in Thread]