From owner-freebsd-questions@FreeBSD.ORG Sun Jun 29 08:13:15 2008 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7D5101065677 for ; Sun, 29 Jun 2008 08:13:15 +0000 (UTC) (envelope-from unga888@yahoo.com) Received: from web57012.mail.re3.yahoo.com (web57012.mail.re3.yahoo.com [66.196.97.116]) by mx1.freebsd.org (Postfix) with SMTP id 277DB8FC16 for ; Sun, 29 Jun 2008 08:13:15 +0000 (UTC) (envelope-from unga888@yahoo.com) Received: (qmail 91579 invoked by uid 60001); 29 Jun 2008 08:13:14 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Received:X-Mailer:Date:From:Reply-To:Subject:To:In-Reply-To:MIME-Version:Content-Type:Message-ID; b=CXWNYMcBQGFW8JNQAAOlZaIDpQJuIddB7Lsak5YanvUMQbtJ7h/t0EuoYHfzkFZj/aO5CumBbUjRXsGvfqDHLewV2rTouPZ/xFF82PtTbvdJ57A9BSaV7ZnvZfTE56MxyRqEsi3ijh07EvBn5lZfhtJ3LKf1c13sDb0kBZVGVTg=; Received: from [165.21.155.117] by web57012.mail.re3.yahoo.com via HTTP; Sun, 29 Jun 2008 01:13:13 PDT X-Mailer: YahooMailWebService/0.7.199 Date: Sun, 29 Jun 2008 01:13:13 -0700 (PDT) From: Unga To: freebsd-questions@freebsd.org In-Reply-To: <470107.5560.qm@web57009.mail.re3.yahoo.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Message-ID: <302401.91458.qm@web57012.mail.re3.yahoo.com> Subject: Re: Error in /usr/src/sbin/setkey X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: unga888@yahoo.com List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Jun 2008 08:13:15 -0000 --- On Sat, 6/28/08, Unga wrote: > From: Unga > 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