Discussion:
Wine CVS won't compile + fix
Michael Mohr
2006-04-27 00:26:36 UTC
Permalink
There appears to be a problem with the cvs tree that prevents me from building winex from cvs. This may well be a problem with my version of m4, or possibly flex. However, these problems will likely manifest themselves whenever someone uses the same versions of these tools that I do. So I thought that I might help out someone else by submitting a patch.

The first fix is to ppl.l in wrc and widl. The file isn't parsed properly unless a space is inserted on a specific line near the top of the file.

The second fix is with wrc's parser.l. It is used to generate lex.yy.c. The problem is that lex.yy.c's yy_scan_string() function doesn't match its prototype. I have never used flex in my projects and so am not familiar with how it works. However, a quick bludgeon with sed sets it straight if you replace all occurrences of yystr with yy_str.

I realize that fix #2 isn't all that elegant, but it appears to work thus far. If anyone cares to reply to this message, please include me in your CC as I'm not subscribed to winex-devel.

TIA

Mike

diff -urN winex/tools/widl/ppl.l winex.new/tools/widl/ppl.l
--- winex/tools/widl/ppl.l 2002-08-04 12:42:56.000000000 -0700
+++ winex.new/tools/widl/ppl.l 2006-04-26 17:09:32.000000000 -0700
@@ -30,7 +30,7 @@
* | {ws} # {ws} error {ws} {anytext} \n
* | {ws} # {ws} warning {ws} {anytext} \n
* | {ws} # {ws} line {ws} " {anytext} " {number} \n
- * | {ws} # {ws} {number} " {anytext} " {number} [{number} [{number}]] \n
+ * | {ws} # {ws} {number} " {anytext} " {number} [{number} [{number}] ] \n
* | {ws} # {ws} \n
*
* ws := [ \t\r\f\v]*
diff -urN winex/tools/wrc/parser.l winex.new/tools/wrc/parser.l
--- winex/tools/wrc/parser.l 2006-01-09 10:21:50.000000000 -0800
+++ winex.new/tools/wrc/parser.l 2006-04-26 17:08:54.000000000 -0700
@@ -53,7 +53,7 @@
*/

/* Exclusive string handling */
-%x yystr
+%x yy_str
/* Exclusive unicode string handling */
%x yylstr
/* Exclusive rcdata single quoted data handling */
@@ -440,46 +440,46 @@
/*
* Normal string scanning
*/
-\" yy_push_state(yystr); cbufidx = 0;
-<yystr>\"{ws}+ |
-<yystr>\" {
+\" yy_push_state(yy_str); cbufidx = 0;
+<yy_str>\"{ws}+ |
+<yy_str>\" {
yy_pop_state();
yylval.str = get_buffered_cstring();
return tSTRING;
}
-<yystr>\\[0-7]{1,3} { /* octal escape sequence */
+<yy_str>\\[0-7]{1,3} { /* octal escape sequence */
int result;
result = strtol(yytext+1, 0, 8);
if ( result > 0xff )
yyerror("Character constant out of range");
addcchar((char)result);
}
-<yystr>\\x[0-9a-fA-F]{2} { /* hex escape sequence */
+<yy_str>\\x[0-9a-fA-F]{2} { /* hex escape sequence */
int result;
result = strtol(yytext+2, 0, 16);
addcchar((char)result);
}
-<yystr>\\x[0-9a-fA-F] { yyerror("Invalid hex escape sequence '%s'", yytext); }
+<yy_str>\\x[0-9a-fA-F] { yyerror("Invalid hex escape sequence '%s'", yytext); }

-<yystr>\\[0-9]+ yyerror("Bad escape secuence");
-<yystr>\\a addcchar('\a');
-<yystr>\\b addcchar('\b');
-<yystr>\\f addcchar('\f');
-<yystr>\\n addcchar('\n');
-<yystr>\\r addcchar('\r');
-<yystr>\\t addcchar('\t');
-<yystr>\\v addcchar('\v');
-<yystr>\\(\n|.) addcchar(yytext[1]);
-<yystr>\\\r\n addcchar(yytext[2]);
-<yystr>[^\\\n\"]+ {
+<yy_str>\\[0-9]+ yyerror("Bad escape secuence");
+<yy_str>\\a addcchar('\a');
+<yy_str>\\b addcchar('\b');
+<yy_str>\\f addcchar('\f');
+<yy_str>\\n addcchar('\n');
+<yy_str>\\r addcchar('\r');
+<yy_str>\\t addcchar('\t');
+<yy_str>\\v addcchar('\v');
+<yy_str>\\(\n|.) addcchar(yytext[1]);
+<yy_str>\\\r\n addcchar(yytext[2]);
+<yy_str>[^\\\n\"]+ {
char *yptr = yytext;
while(*yptr)
addcchar(*yptr++);
}
-<yystr>\"\" addcchar('\"'); /* "bla""bla" -> "bla\"bla" */
-<yystr>\\\"\" addcchar('\"'); /* "bla\""bla" -> "bla\"bla" */
-<yystr>\"{ws}+\" ; /* "bla" "bla" -> "blabla" */
-<yystr>\n yyerror("Unterminated string");
+<yy_str>\"\" addcchar('\"'); /* "bla""bla" -> "bla\"bla" */
+<yy_str>\\\"\" addcchar('\"'); /* "bla\""bla" -> "bla\"bla" */
+<yy_str>\"{ws}+\" ; /* "bla" "bla" -> "blabla" */
+<yy_str>\n yyerror("Unterminated string");

/*
* Raw data scanning
diff -urN winex/tools/wrc/ppl.l winex.new/tools/wrc/ppl.l
--- winex/tools/wrc/ppl.l 2001-12-31 02:53:15.000000000 -0800
+++ winex.new/tools/wrc/ppl.l 2006-04-26 17:09:20.000000000 -0700
@@ -30,7 +30,7 @@
* | {ws} # {ws} error {ws} {anytext} \n
* | {ws} # {ws} warning {ws} {anytext} \n
* | {ws} # {ws} line {ws} " {anytext} " {number} \n
- * | {ws} # {ws} {number} " {anytext} " {number} [{number} [{number}]] \n
+ * | {ws} # {ws} {number} " {anytext} " {number} [{number} [{number}] ] \n
* | {ws} # {ws} \n
*
* ws := [ \t\r\f\v]*
iogurt
2006-05-01 06:22:42 UTC
Permalink
2 Michael Mohr <m.mohr <at> laposte.net>

I have applyied both your fixes, but error with gcc4.0.2 with Cedega CVS 2006 05
01 is following:

...
gcc -MMD -c -I. -I. -I../../include -I../../include -g -O2 -Wall
-mpreferred-stack-boundary=2 -fno-keep-static-consts -D__const=const
-fno-strict-aliasing -Wa,--execstack -D__int8=char -D__int16=short -D__int32=int
"-D__int64=long long" -D__WINE__ -D_REENTRANT -I/usr/X11R6/include -o lex.ppl.o
lex.ppl.c
bison -y -d -t ./parser.y
конфликты: 2 сдвига/вывода
gcc -MMD -c -I. -I. -I../../include -I../../include -g -O2 -Wall
-mpreferred-stack-boundary=2 -fno-keep-static-consts -D__const=const
-fno-strict-aliasing -Wa,--execstack -D__int8=char -D__int16=short -D__int32=int
"-D__int64=long long" -D__WINE__ -D_REENTRANT -I/usr/X11R6/include -o y.tab.o
y.tab.c
flex -Cf -d -8 ./parser.l
gcc -MMD -c -I. -I. -I../../include -I../../include -g -O2 -Wall
-mpreferred-stack-boundary=2 -fno-keep-static-consts -D__const=const
-fno-strict-aliasing -Wa,--execstack -D__int8=char -D__int16=short -D__int32=int
"-D__int64=long long" -D__WINE__ -D_REENTRANT -I/usr/X11R6/include -o lex.yy.o
lex.yy.c
lex.yy.c:7200: error: syntax error before numeric constant
lex.yy.c: In function ‘yy_scan_string’:
lex.yy.c:7205: error: number of arguments doesn’t match prototype
lex.yy.c:239: error: prototype declaration
lex.yy.c:7207: error: subscripted value is neither array nor pointer
lex.yy.c:7210: warning: passing argument 1 of ‘yy_scan_bytes’ makes pointer from
integer without a cast
make[2]: *** [lex.yy.o] Ошибка 1
make[2]: Leaving directory `/home/install/gamez/winex/tools/wrc'
make[1]: *** [wrc] Ошибка 2
make[1]: Leaving directory `/home/install/gamez/winex/tools'
make: *** [tools] Ошибка 2

Can anybody solve this problem.
My OS is ASPLinux v.11 (based on Fedora Core 4)
Mike Mohr
2006-05-01 21:43:46 UTC
Permalink
It looks like you didn't apply fix #2, or you didn't do it correctly.
Just use the attached patch on a clean copy of cedega cvs and it will
compile:

diff -urN winex/tools/widl/ppl.l winex.new/tools/widl/ppl.l
--- winex/tools/widl/ppl.l 2002-08-04 12:42:56.000000000 -0700
+++ winex.new/tools/widl/ppl.l 2006-04-26 17:09:32.000000000 -0700
@@ -30,7 +30,7 @@
* | {ws} # {ws} error {ws} {anytext} \n
* | {ws} # {ws} warning {ws} {anytext} \n
* | {ws} # {ws} line {ws} " {anytext} " {number} \n
- * | {ws} # {ws} {number} " {anytext} " {number} [{number} [{number}]] \n
+ * | {ws} # {ws} {number} " {anytext} " {number} [{number} [{number}] ] \n
* | {ws} # {ws} \n
*
* ws := [ \t\r\f\v]*
diff -urN winex/tools/wrc/parser.l winex.new/tools/wrc/parser.l
--- winex/tools/wrc/parser.l 2006-01-09 10:21:50.000000000 -0800
+++ winex.new/tools/wrc/parser.l 2006-04-26 17:08:54.000000000 -0700
@@ -53,7 +53,7 @@
*/

/* Exclusive string handling */
-%x yystr
+%x yy_str
/* Exclusive unicode string handling */
%x yylstr
/* Exclusive rcdata single quoted data handling */
@@ -440,46 +440,46 @@
/*
* Normal string scanning
*/
-\" yy_push_state(yystr); cbufidx = 0;
-<yystr>\"{ws}+ |
-<yystr>\" {
+\" yy_push_state(yy_str); cbufidx = 0;
+<yy_str>\"{ws}+ |
+<yy_str>\" {
yy_pop_state();
yylval.str = get_buffered_cstring();
return tSTRING;
}
-<yystr>\\[0-7]{1,3} { /* octal escape sequence */
+<yy_str>\\[0-7]{1,3} { /* octal escape sequence */
int result;
result = strtol(yytext+1, 0, 8);
if ( result > 0xff )
yyerror("Character constant out of range");
addcchar((char)result);
}
-<yystr>\\x[0-9a-fA-F]{2} { /* hex escape sequence */
+<yy_str>\\x[0-9a-fA-F]{2} { /* hex escape sequence */
int result;
result = strtol(yytext+2, 0, 16);
addcchar((char)result);
}
-<yystr>\\x[0-9a-fA-F] { yyerror("Invalid hex escape sequence '%s'", yytext); }
+<yy_str>\\x[0-9a-fA-F] { yyerror("Invalid hex escape sequence '%s'",
yytext); }

-<yystr>\\[0-9]+ yyerror("Bad escape secuence");
-<yystr>\\a addcchar('\a');
-<yystr>\\b addcchar('\b');
-<yystr>\\f addcchar('\f');
-<yystr>\\n addcchar('\n');
-<yystr>\\r addcchar('\r');
-<yystr>\\t addcchar('\t');
-<yystr>\\v addcchar('\v');
-<yystr>\\(\n|.) addcchar(yytext[1]);
-<yystr>\\\r\n addcchar(yytext[2]);
-<yystr>[^\\\n\"]+ {
+<yy_str>\\[0-9]+ yyerror("Bad escape secuence");
+<yy_str>\\a addcchar('\a');
+<yy_str>\\b addcchar('\b');
+<yy_str>\\f addcchar('\f');
+<yy_str>\\n addcchar('\n');
+<yy_str>\\r addcchar('\r');
+<yy_str>\\t addcchar('\t');
+<yy_str>\\v addcchar('\v');
+<yy_str>\\(\n|.) addcchar(yytext[1]);
+<yy_str>\\\r\n addcchar(yytext[2]);
+<yy_str>[^\\\n\"]+ {
char *yptr = yytext;
while(*yptr)
addcchar(*yptr++);
}
-<yystr>\"\" addcchar('\"'); /* "bla""bla" -> "bla\"bla" */
-<yystr>\\\"\" addcchar('\"'); /* "bla\""bla" -> "bla\"bla" */
-<yystr>\"{ws}+\" ; /* "bla" "bla" -> "blabla" */
-<yystr>\n yyerror("Unterminated string");
+<yy_str>\"\" addcchar('\"'); /* "bla""bla" -> "bla\"bla" */
+<yy_str>\\\"\" addcchar('\"'); /* "bla\""bla" -> "bla\"bla" */
+<yy_str>\"{ws}+\" ; /* "bla" "bla" -> "blabla" */
+<yy_str>\n yyerror("Unterminated string");

/*
* Raw data scanning
diff -urN winex/tools/wrc/ppl.l winex.new/tools/wrc/ppl.l
--- winex/tools/wrc/ppl.l 2001-12-31 02:53:15.000000000 -0800
+++ winex.new/tools/wrc/ppl.l 2006-04-26 17:09:20.000000000 -0700
@@ -30,7 +30,7 @@
* | {ws} # {ws} error {ws} {anytext} \n
* | {ws} # {ws} warning {ws} {anytext} \n
* | {ws} # {ws} line {ws} " {anytext} " {number} \n
- * | {ws} # {ws} {number} " {anytext} " {number} [{number} [{number}]] \n
+ * | {ws} # {ws} {number} " {anytext} " {number} [{number} [{number}] ] \n
* | {ws} # {ws} \n
*
* ws := [ \t\r\f\v]*
iogurt
2006-05-02 22:44:36 UTC
Permalink
1.Your diff data I have saved as folowinf patch:

--- winex/tools/widl/ppl.l 2002-08-04 12:42:56.000000000 -0700
+++ winex.new/tools/widl/ppl.l 2006-04-26 17:09:32.000000000 -0700
<at> <at> -30,7 +30,7 <at> <at>
* | {ws} # {ws} error {ws} {anytext} \n
* | {ws} # {ws} warning {ws} {anytext} \n
* | {ws} # {ws} line {ws} " {anytext} " {number} \n
- * | {ws} # {ws} {number} " {anytext} " {number} [{number} [{number}]] \n
+ * | {ws} # {ws} {number} " {anytext} " {number} [{number} [{number}] ] \n
* | {ws} # {ws} \n
*
* ws := [ \t\r\f\v]*
--- winex/tools/wrc/parser.l 2006-01-09 10:21:50.000000000 -0800
+++ winex.new/tools/wrc/parser.l 2006-04-26 17:08:54.000000000 -0700
<at> <at> -53,7 +53,7 <at> <at>
*/

/* Exclusive string handling */
-%x yystr
+%x yy_str
/* Exclusive unicode string handling */
%x yylstr
/* Exclusive rcdata single quoted data handling */
<at> <at> -440,46 +440,46 <at> <at>
/*
* Normal string scanning
*/
-\" yy_push_state(yystr); cbufidx = 0;
-<yystr>\"{ws}+ |
-<yystr>\" {
+\" yy_push_state(yy_str); cbufidx = 0;
+<yy_str>\"{ws}+ |
+<yy_str>\" {
yy_pop_state();
yylval.str = get_buffered_cstring();
return tSTRING;
}
-<yystr>\\[0-7]{1,3} { /* octal escape sequence */
+<yy_str>\\[0-7]{1,3} { /* octal escape sequence */
int result;
result = strtol(yytext+1, 0, 8);
if ( result > 0xff )
yyerror("Character constant out of range");
addcchar((char)result);
}
-<yystr>\\x[0-9a-fA-F]{2} { /* hex escape sequence */
+<yy_str>\\x[0-9a-fA-F]{2} { /* hex escape sequence */
int result;
result = strtol(yytext+2, 0, 16);
addcchar((char)result);
}
-<yystr>\\x[0-9a-fA-F] { yyerror("Invalid hex escape sequence '%s'", yytext); }
+<yy_str>\\x[0-9a-fA-F] { yyerror("Invalid hex escape sequence '%s'", yytext); }

-<yystr>\\[0-9]+ yyerror("Bad escape secuence");
-<yystr>\\a addcchar('\a');
-<yystr>\\b addcchar('\b');
-<yystr>\\f addcchar('\f');
-<yystr>\\n addcchar('\n');
-<yystr>\\r addcchar('\r');
-<yystr>\\t addcchar('\t');
-<yystr>\\v addcchar('\v');
-<yystr>\\(\n|.) addcchar(yytext[1]);
-<yystr>\\\r\n addcchar(yytext[2]);
-<yystr>[^\\\n\"]+ {
+<yy_str>\\[0-9]+ yyerror("Bad escape secuence");
+<yy_str>\\a addcchar('\a');
+<yy_str>\\b addcchar('\b');
+<yy_str>\\f addcchar('\f');
+<yy_str>\\n addcchar('\n');
+<yy_str>\\r addcchar('\r');
+<yy_str>\\t addcchar('\t');
+<yy_str>\\v addcchar('\v');
+<yy_str>\\(\n|.) addcchar(yytext[1]);
+<yy_str>\\\r\n addcchar(yytext[2]);
+<yy_str>[^\\\n\"]+ {
char *yptr = yytext;
while(*yptr)
addcchar(*yptr++);
}
-<yystr>\"\" addcchar('\"'); /* "bla""bla" -> "bla\"bla" */
-<yystr>\\\"\" addcchar('\"'); /* "bla\""bla" -> "bla\"bla" */
-<yystr>\"{ws}+\" ; /* "bla" "bla" -> "blabla" */
-<yystr>\n yyerror("Unterminated string");
+<yy_str>\"\" addcchar('\"'); /* "bla""bla" -> "bla\"bla" */
+<yy_str>\\\"\" addcchar('\"'); /* "bla\""bla" -> "bla\"bla" */
+<yy_str>\"{ws}+\" ; /* "bla" "bla" -> "blabla" */
+<yy_str>\n yyerror("Unterminated string");

/*
* Raw data scanning
--- winex/tools/wrc/ppl.l 2001-12-31 02:53:15.000000000 -0800
+++ winex.new/tools/wrc/ppl.l 2006-04-26 17:09:20.000000000 -0700
<at> <at> -30,7 +30,7 <at> <at>
* | {ws} # {ws} error {ws} {anytext} \n
* | {ws} # {ws} warning {ws} {anytext} \n
* | {ws} # {ws} line {ws} " {anytext} " {number} \n
- * | {ws} # {ws} {number} " {anytext} " {number} [{number} [{number}]] \n
+ * | {ws} # {ws} {number} " {anytext} " {number} [{number} [{number}] ] \n
* | {ws} # {ws} \n
*
* ws := [ \t\r\f\v]*

2. I have applayied it by following command:

pathch -p0 <patch

3. What I have done wrong?

Loading...