gnupic: Patch for "invalid lvalue in assignment" in scan.l
Subject:
Re: Patch for "invalid lvalue in assignment" in scan.l
From:
Craig Franklin ####@####.####
Date:
2 Nov 2004 04:09:55 +0000
Message-Id: <4186C2A7.3020701@users.sourceforge.net>
Marco Pantaleoni wrote:
>Hi,
>I've encountered a problem building the CVS version of gputils
>on debian testing (with all released versions up to 0.12.4 everything
>worked).
>Here is a dump of the relevant make output:
>
>flex -i scan.l
>scan.l:122: warning, the character range [-ÿ] is ambiguous in a case-insensitive scanner
>scan.l:122: warning, the character range [-ÿ] is ambiguous in a case-insensitive scanner
>scan.l:304: warning, the character range [-ÿ] is ambiguous in a case-insensitive scanner
>sed '/^#/ s|lex.yy\.c|scan.c|' lex.yy.c >scan.c
>rm -f lex.yy.c
>if gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../libgputils -I../include -Wall -pedantic -g -O2 -MT scan.o -MD -MP -MF ".deps/scan.Tpo" -c -o scan.o scan.c; \
>then mv -f ".deps/scan.Tpo" ".deps/scan.Po"; else rm -f ".deps/scan.Tpo"; exit 1; fi
>scan.l: In function `execute_macro':
>scan.l:614: warning: use of conditional expressions as lvalues is deprecated
>scan.l:614: error: invalid lvalue in assignment
>scan.l: In function `repeat_while':
>scan.l:635: warning: use of conditional expressions as lvalues is deprecated
>scan.l:635: error: invalid lvalue in assignment
>scan.l: At top level:
>scan.c:2323: warning: `yyunput' defined but not used
>make: *** [scan.o] Error 1
>
>I've tried with gcc 3.3.3, 3.0.4 and 2.7.2.3 (on debian testing).
>flex is 2.5.31
>
>
Flex 2.5.31, that is the problem. We have discussed this before:
http://www.linuxhacker.org/cgi-bin/ezmlm-cgi?1:mss:3451:ibhbdmekomoalahmnlee
>It seems that the problem is related to scan.l trying to assign to
>YY_CURRENT_BUFFER.
>Substituting YY_CURRENT_BUFFER_LVALUE in place of YY_CURRENT_BUFFER
>in lines 614 and 635 solves the problem.
>
>
>
This change only works for flex 2.5.31, an unstable release. It does
not work on 2.5.4, the stable release. I won't apply this patch.
I have modified the code so it is no longer susceptible to this change
in flex. I still don't recommend using the new flex. There are several
new flex bugs and I don't know how they effect gputils. Configure will
now generate a warning if you use any version of flex other than 2.5.4.
I will remove the warning once flex stabilizes a little.
>I attach a patch, hoping it could be useful to someone else.
>
>Cheers,
>Marco
>
>
>
>------------------------------------------------------------------------
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: ####@####.####
>For additional commands, e-mail: ####@####.####
>