pkgsrc-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: pkg/51100: cdecl rejects valid syntax



The following reply was made to PR pkg/51100; it has been noted by GNATS.

From: David Holland <dholland-pbugs%netbsd.org@localhost>
To: gnats-bugs%NetBSD.org@localhost
Cc: john%iastate.edu@localhost
Subject: Re: pkg/51100: cdecl rejects valid syntax
Date: Thu, 26 May 2016 05:04:46 +0000

 On Fri, Apr 29, 2016 at 03:20:00AM +0000, john%iastate.edu@localhost wrote:
  > The cdecl program declares that having storage-class and
  > a type-qualifier is a syntax error, for example:
  > 	cdecl> explain static const int jsb
  > 	syntax error
 
 Try this patch... but please send it upstream, if there's any kind of
 non-comatose upstream. If there isn't, let us know and I'll commit it
 in pkgsrc as better than nothing.
 
 Note that the patch produces this change in the build output:
  -yacc: 7 shift/reduce conflicts.
  +yacc: 6 shift/reduce conflicts.
 
 It's quite likely that the other six conflicts also reflect bugs.
 
 
 --- cdgram.y~	1996-01-12 06:06:58.000000000 +0000
 +++ cdgram.y
 @@ -84,10 +84,20 @@ stmt		: HELP NL
  			docast(NullCP, $2.left, $2.right, $2.type);
  			}
  
 -		| EXPLAIN opt_storage opt_constvol_list type cdecl NL
 +		| EXPLAIN opt_constvol_list type cdecl NL
  			{
 -			Debug((stderr, "stmt: EXPLAIN opt_storage opt_constvol_list type cdecl\n"));
 -			Debug((stderr, "\topt_storage='%s'\n", $2));
 +			Debug((stderr, "stmt: EXPLAIN opt_constvol_list type cdecl\n"));
 +			Debug((stderr, "\topt_constvol_list='%s'\n", $2));
 +			Debug((stderr, "\ttype='%s'\n", $3));
 +			Debug((stderr, "\tcdecl='%s'\n", $4));
 +			Debug((stderr, "\tprev = '%s'\n", visible(prev)));
 +			dodexplain(ds(""), $2, $3, $4);
 +			}
 +
 +		| EXPLAIN storage opt_constvol_list type cdecl NL
 +			{
 +			Debug((stderr, "stmt: EXPLAIN storage opt_constvol_list type cdecl\n"));
 +			Debug((stderr, "\tstorage='%s'\n", $2));
  			Debug((stderr, "\topt_constvol_list='%s'\n", $3));
  			Debug((stderr, "\ttype='%s'\n", $4));
  			Debug((stderr, "\tcdecl='%s'\n", $5));
 @@ -105,14 +115,13 @@ stmt		: HELP NL
  			dodexplain($2, $3, NullCP, $4);
  			}
  
 -		| EXPLAIN opt_storage constvol_list cdecl NL
 +		| EXPLAIN constvol_list cdecl NL
  			{
 -			Debug((stderr, "stmt: EXPLAIN opt_storage constvol_list cdecl\n"));
 -			Debug((stderr, "\topt_storage='%s'\n", $2));
 -			Debug((stderr, "\tconstvol_list='%s'\n", $3));
 -			Debug((stderr, "\tcdecl='%s'\n", $4));
 +			Debug((stderr, "stmt: EXPLAIN constvol_list cdecl\n"));
 +			Debug((stderr, "\tconstvol_list='%s'\n", $2));
 +			Debug((stderr, "\tcdecl='%s'\n", $3));
  			Debug((stderr, "\tprev = '%s'\n", visible(prev)));
 -			dodexplain($2, $3, NullCP, $4);
 +			dodexplain(ds(""), $2, NullCP, $3);
  			}
  
  		| EXPLAIN '(' opt_constvol_list type cast ')' optNAME NL
 
 
 -- 
 David A. Holland
 dholland%netbsd.org@localhost
 


Home | Main Index | Thread Index | Old Index