Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 29 Jun 2008 01:13:13 -0700 (PDT)
From:      Unga <unga888@yahoo.com>
To:        freebsd-questions@freebsd.org
Subject:   Re: Error in /usr/src/sbin/setkey
Message-ID:  <302401.91458.qm@web57012.mail.re3.yahoo.com>
In-Reply-To: <470107.5560.qm@web57009.mail.re3.yahoo.com>

next in thread | previous in thread | raw e-mail | index | archive | help
--- On Sat, 6/28/08, Unga <unga888@yahoo.com> wrote:

> From: Unga <unga888@yahoo.com>
> 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



      



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?302401.91458.qm>