Package: flex
Version: 2.5.33-2
Severity: minor
Tags: patch

For INN snapshot generation, I compile with extensive warnings and -Werror
to catch any compiler warnings or mistakes before a release.  After the
upgrade to flex in testing, this started failing with:

flex configfile.l
mv lex.yy.c config_l.c
bison -y -d configfile.y
mv y.tab.h config_y.h
mv y.tab.c config_y.c
gcc -g -O -DDEBUG=1 -Wall -W -Wendif-labels -Wpointer-arith -Wbad-function-cast 
-Wcast-align -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes 
-Wnested-externs -Werror -g -O2 -I../include     -c -o config_l.o config_l.c
cc1: warnings being treated as errors
lex.yy.c: In function 'yy_get_next_buffer':
lex.yy.c:1290: warning: comparison between signed and unsigned

The attached patch adds a cast to the generated code to silence this
warning.  Visual inspection of the code shows that num_to_read cannot
be negative at the point of this cast, so it shouldn't introduce any
errors.  flex passes its test suite with this change.

Thanks!

-- System Information:
Debian Release: testing/unstable
  APT prefers testing
  APT policy: (990, 'testing'), (500, 'unstable'), (1, 'experimental')
Architecture: i386 (i686)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.15-1-686
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968)

Versions of packages flex depends on:
ii  debconf [debconf-2.0]         1.4.71     Debian configuration management sy
ii  libc6                         2.3.6-3    GNU C Library: Shared libraries an
ii  m4                            1.4.4-1    a macro processing language

Versions of packages flex recommends:
ii  gcc [c-compiler]              4:4.0.2-2  The GNU C compiler
ii  gcc-3.3 [c-compiler]          1:3.3.6-10 The GNU C compiler
ii  gcc-4.0 [c-compiler]          4.0.3-1    The GNU C compiler

-- debconf information:
  flex/upgrade/pre_2.5.5: false
--- flex.skl.orig	2006-03-26 10:27:46.000000000 -0800
+++ flex.skl	2006-03-26 10:25:23.000000000 -0800
@@ -1627,7 +1627,7 @@
 
 		/* Read in more data. */
 		YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
-			YY_G(yy_n_chars), num_to_read );
+			YY_G(yy_n_chars), (size_t) num_to_read );
 
 		YY_CURRENT_BUFFER_LVALUE->yy_n_chars = YY_G(yy_n_chars);
 		}

Reply via email to