[RFC/RFA] suppress bison warnings

Andrew Cagney ac131313@ges.redhat.com
Wed Sep 18 12:01:00 GMT 2002


> I discovered that bison emits several warnings when 
> converting the *-exp.y into *-exp.tab.c files
> in the gdb directory.
> 
>    This is probably a new feature of  bison 1.35 ...
> 
>   The patch is probably correct, but as I am no parser specialist,
> I didn't want to commit it under obvious rule.

(I'm not either, haven't used yacc for, er never mind :-).

Yes definitly OK, also ok with the 5.3 branch.  People will be using 5.3 
with this new bison so it should be there as well.

Andrew


> ChangeLog entry:
> 
> 2002-09-16  Pierre Muller  <muller@ics.u-strabg.fr>
> 
> 	* (c-exp.y): Add missing semicolons to end rules.
> 	(f-exp.y): Likewise.
> 	(m2-exp.y): Likewise.
> 	(p-exp.y): Likewise.
> 
> $ cvs diff -u -p *.y
> Index: c-exp.y
> ===================================================================
> RCS file: /cvs/src/src/gdb/c-exp.y,v
> retrieving revision 1.12
> diff -u -p -r1.12 c-exp.y
> --- c-exp.y     3 Sep 2002 02:45:56 -0000       1.12
> +++ c-exp.y     17 Sep 2002 07:18:57 -0000
> @@ -247,9 +247,10 @@ exp1       :       exp
>   /* Expressions, not including the comma operator.  */
>   exp    :       '*' exp    %prec UNARY
>                          { write_exp_elt_opcode (UNOP_IND); }
> -
> +       ;
>   exp    :       '&' exp    %prec UNARY
>                          { write_exp_elt_opcode (UNOP_ADDR); }
> +       ;
> 
>   exp    :       '-' exp    %prec UNARY
>                          { write_exp_elt_opcode (UNOP_NEG); }
> Index: f-exp.y
> ===================================================================
> RCS file: /cvs/src/src/gdb/f-exp.y,v
> retrieving revision 1.8
> diff -u -p -r1.8 f-exp.y
> --- f-exp.y     3 Sep 2002 02:45:56 -0000       1.8
> +++ f-exp.y     17 Sep 2002 07:18:57 -0000
> @@ -241,9 +241,11 @@ exp     :       '(' exp ')'
>   /* Expressions, not including the comma operator.  */
>   exp    :       '*' exp    %prec UNARY
>                          { write_exp_elt_opcode (UNOP_IND); }
> +       ;
> 
>   exp    :       '&' exp    %prec UNARY
>                          { write_exp_elt_opcode (UNOP_ADDR); }
> +       ;
> 
>   exp    :       '-' exp    %prec UNARY
>                          { write_exp_elt_opcode (UNOP_NEG); }
> @@ -283,6 +285,7 @@ arglist     :       exp
> 
>   arglist :      substring
>                           { arglist_len = 2;}
> +       ;
> 
>   arglist        :       arglist ',' exp   %prec ABOVE_COMMA
>                          { arglist_len++; }
> Index: m2-exp.y
> ===================================================================
> RCS file: /cvs/src/src/gdb/m2-exp.y,v
> retrieving revision 1.6
> diff -u -p -r1.6 m2-exp.y
> --- m2-exp.y    3 Sep 2002 02:45:56 -0000       1.6
> +++ m2-exp.y    17 Sep 2002 07:18:57 -0000
> @@ -216,6 +216,7 @@ type_exp:   type
> 
>   exp     :       exp '^'   %prec UNARY
>                           { write_exp_elt_opcode (UNOP_IND); }
> +       ;
> 
>   exp    :       '-'
>                          { number_sign = -1; }
> @@ -330,6 +331,7 @@ exp :       INCL '(' exp ',' exp ')'
> 
>   exp    :       EXCL '(' exp ',' exp ')'
>                          { error("Sets are not implemented.");}
> +       ;
> 
>   set    :       '{' arglist '}'
>                          { error("Sets are not implemented.");}
> Index: p-exp.y
> ===================================================================
> RCS file: /cvs/src/src/gdb/p-exp.y,v
> retrieving revision 1.13
> diff -u -p -r1.13 p-exp.y
> --- p-exp.y     3 Sep 2002 02:45:56 -0000       1.13
> +++ p-exp.y     17 Sep 2002 07:18:57 -0000
> @@ -257,11 +257,13 @@ exp       :       exp '^'   %prec UNARY
>                          { write_exp_elt_opcode (UNOP_IND);
>                            if (current_type)
>                              current_type = TYPE_TARGET_TYPE (current_type); }
> +       ;
> 
>   exp    :       '@' exp    %prec UNARY
>                          { write_exp_elt_opcode (UNOP_ADDR);
>                            if (current_type)
>                              current_type = TYPE_POINTER_TYPE (current_type); }
> +       ;
> 
>   exp    :       '-' exp    %prec UNARY
>                          { write_exp_elt_opcode (UNOP_NEG); }
> @@ -317,6 +319,7 @@ exp :       exp '['
>                            write_exp_elt_opcode (BINOP_SUBSCRIPT);
>                            if (current_type)
>                              current_type = TYPE_TARGET_TYPE (current_type); }
> +       ;
> 
>   exp    :       exp '('
>                          /* This is to save the value of arglist_len
> 
> 
> Pierre Muller
> Institut Charles Sadron
> 6,rue Boussingault
> F 67083 STRASBOURG CEDEX (France)
> mailto:muller@ics.u-strasbg.fr
> Phone : (33)-3-88-41-40-07  Fax : (33)-3-88-41-40-99
> 




More information about the Gdb-patches mailing list