--- On Sat, 6/28/08, Unga [EMAIL PROTECTED] wrote:
From: Unga [EMAIL PROTECTED]
Subject: Error in /usr/src/sbin/setkey
To: freebsd-questions@freebsd.org
Date: Saturday, June 28, 2008, 9:15 PM
Hi all
I made a separate make in /usr/src/sbin, I get a error in
/usr/src/sbin/setkey as follows:
=== setkey (all)
yacc -d /usr/src/sbin/setkey/parse.y
cp y.tab.c parse.c
cc -O2 -fno-strict-aliasing -pipe -I/usr/src/sbin/setkey
-I/usr/src/sbin/setkey
/../../lib/libipsec
-I/usr/src/sbin/setkey/../../lib/libipsec
-I/usr/src/sbin/se
tkey/../../sys/netipsec -DIPSEC_DEBUG -DYY_NO_UNPUT -DINET6
-I. -Wsystem-headers
-Wno-pointer-sign -c /usr/src/sbin/setkey/setkey.c
cc -O2 -fno-strict-aliasing -pipe -I/usr/src/sbin/setkey
-I/usr/src/sbin/setkey
/../../lib/libipsec
-I/usr/src/sbin/setkey/../../lib/libipsec
-I/usr/src/sbin/se
tkey/../../sys/netipsec -DIPSEC_DEBUG -DYY_NO_UNPUT -DINET6
-I. -Wsystem-headers
-Wno-pointer-sign -c parse.c
lex -t /usr/src/sbin/setkey/token.l token.c
cc -O2 -fno-strict-aliasing -pipe -I/usr/src/sbin/setkey
-I/usr/src/sbin/setkey
/../../lib/libipsec
-I/usr/src/sbin/setkey/../../lib/libipsec
-I/usr/src/sbin/se
tkey/../../sys/netipsec -DIPSEC_DEBUG -DYY_NO_UNPUT -DINET6
-I. -Wsystem-headers
-Wno-pointer-sign -c token.c
/usr/src/sbin/setkey/token.l: In function 'yylex':
/usr/src/sbin/setkey/token.l:226: error: lvalue required as
increment operand
*** Error code 1
Stop in /usr/src/sbin/setkey.
*** Error code 1
Stop in /usr/src/sbin.
I have narrow down the issue. The issue is with /usr/src/sbin/setkey/token.l .
The relevant section from token.l:
{quotedstring} {
char *p = yytext;
while (*++p != '') ;
*p = '\0';
yytext++;
yylval.val.len = yyleng - 2;
yylval.val.buf = strdup(yytext);
if (!yylval.val.buf)
yyfatal(insufficient memory);
return(QUOTEDSTRING);
}
The variable yytext is declared as follows inside the token.c:
extern char yytext[];
But the variable yytext is not declared in any file in /usr/src/sbin/setkey/.
Comment out yytext++; line cleanly compiles the token.c.
Similar use of token.l is there in /usr/src/sbin/devd/. The variable yytext is
used but no increment operator is used on it and it is also not declared in any
file in /usr/src/sbin/devd/, but that token.c get cleanly compiles.
Is it an error/mistake to have an yytext++; line inside token.l? What should
be the correct fix for this?
KInd regards
Unga
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]