1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78
|
From: Nicolas Schodet <nico@ni.fr.eu.org>
Date: Tue, 11 Mar 2025 22:58:30 +0100
Subject: Fix c-parse.y build error with recent bison
Forwarded: not-needed
This code is no longer present in recent GCC versions.
---
gcc/c-parse.y | 24 ++++++++++++------------
1 file changed, 12 insertions(+), 12 deletions(-)
diff --git a/gcc/c-parse.y b/gcc/c-parse.y
index 7f749f0..290594d 100644
--- a/gcc/c-parse.y
+++ b/gcc/c-parse.y
@@ -591,7 +591,7 @@ primary:
IDENTIFIER
{
if (yychar == YYEMPTY)
- yychar = YYLEX;
+ yychar = yylex();
$$ = build_external_ref ($1, yychar == '(');
}
| CONSTANT
@@ -1647,34 +1647,34 @@ enum_head:
structsp_attr:
struct_head identifier '{'
- { $$ = start_struct (RECORD_TYPE, $2);
+ { $<ttype>$ = start_struct (RECORD_TYPE, $2);
/* Start scope of tag before parsing components. */
}
component_decl_list '}' maybe_attribute
- { $$ = finish_struct ($<ttype>4, nreverse ($5),
+ { $<ttype>$ = finish_struct ($<ttype>4, nreverse ($5),
chainon ($1, $7)); }
| struct_head '{' component_decl_list '}' maybe_attribute
- { $$ = finish_struct (start_struct (RECORD_TYPE, NULL_TREE),
+ { $<ttype>$ = finish_struct (start_struct (RECORD_TYPE, NULL_TREE),
nreverse ($3), chainon ($1, $5));
}
| union_head identifier '{'
- { $$ = start_struct (UNION_TYPE, $2); }
+ { $<ttype>$ = start_struct (UNION_TYPE, $2); }
component_decl_list '}' maybe_attribute
- { $$ = finish_struct ($<ttype>4, nreverse ($5),
+ { $<ttype>$ = finish_struct ($<ttype>4, nreverse ($5),
chainon ($1, $7)); }
| union_head '{' component_decl_list '}' maybe_attribute
- { $$ = finish_struct (start_struct (UNION_TYPE, NULL_TREE),
+ { $<ttype>$ = finish_struct (start_struct (UNION_TYPE, NULL_TREE),
nreverse ($3), chainon ($1, $5));
}
| enum_head identifier '{'
- { $$ = start_enum ($2); }
+ { $<ttype>$ = start_enum ($2); }
enumlist maybecomma_warn '}' maybe_attribute
- { $$ = finish_enum ($<ttype>4, nreverse ($5),
+ { $<ttype>$ = finish_enum ($<ttype>4, nreverse ($5),
chainon ($1, $8)); }
| enum_head '{'
- { $$ = start_enum (NULL_TREE); }
+ { $<ttype>$ = start_enum (NULL_TREE); }
enumlist maybecomma_warn '}' maybe_attribute
- { $$ = finish_enum ($<ttype>3, nreverse ($4),
+ { $<ttype>$ = finish_enum ($<ttype>3, nreverse ($4),
chainon ($1, $7)); }
;
@@ -2135,7 +2135,7 @@ do_stmt_start:
save_location:
{ if (yychar == YYEMPTY)
- yychar = YYLEX;
+ yychar = yylex();
$$ = input_location; }
;
|