aboutsummaryrefslogtreecommitdiff
path: root/gdb/d-exp.y
diff options
context:
space:
mode:
authorTom de Vries <tdevries@suse.de>2023-08-14 18:32:29 +0200
committerTom de Vries <tdevries@suse.de>2023-08-14 18:32:29 +0200
commit9972aac27d5d664a29abc88acd3a84c1e72064c4 (patch)
treea717d488960f10226be6610a1ce6247d96a039f3 /gdb/d-exp.y
parent6a93ab8af49be41a44af1b4651e9ab2ebc6d2f77 (diff)
downloadbinutils-9972aac27d5d664a29abc88acd3a84c1e72064c4.zip
binutils-9972aac27d5d664a29abc88acd3a84c1e72064c4.tar.gz
binutils-9972aac27d5d664a29abc88acd3a84c1e72064c4.tar.bz2
[gdb/build] Fix struct token_and_value odr violation
When build gdb with -O2 -flto I run into: ... gdb/c-exp.y:3003:8: warning: type 'struct token_and_value' violates the C++ \ One Definition Rule [-Wodr] struct token_and_value ^ gdb/d-exp.y:1310:8: note: a different type is defined in another translation \ unit struct token_and_value ^ ... Fix this by renaming to c_token_and_value and d_token_and_value. Likewise in gdb/go-exp.y, renaming to go_token_and_value. Tested on x86_64-linux. Approved-By: Tom Tromey <tom@tromey.com> PR build/22395 Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=22395
Diffstat (limited to 'gdb/d-exp.y')
-rw-r--r--gdb/d-exp.y10
1 files changed, 5 insertions, 5 deletions
diff --git a/gdb/d-exp.y b/gdb/d-exp.y
index b0f2c0d..8620a67 100644
--- a/gdb/d-exp.y
+++ b/gdb/d-exp.y
@@ -1307,7 +1307,7 @@ lex_one_token (struct parser_state *par_state)
}
/* An object of this type is pushed on a FIFO by the "outer" lexer. */
-struct token_and_value
+struct d_token_and_value
{
int token;
YYSTYPE value;
@@ -1316,7 +1316,7 @@ struct token_and_value
/* A FIFO of tokens that have been read but not yet returned to the
parser. */
-static std::vector<token_and_value> token_fifo;
+static std::vector<d_token_and_value> token_fifo;
/* Non-zero if the lexer should return tokens from the FIFO. */
static int popping;
@@ -1404,7 +1404,7 @@ classify_inner_name (struct parser_state *par_state,
static int
yylex (void)
{
- token_and_value current;
+ d_token_and_value current;
int last_was_dot;
struct type *context_type = NULL;
int last_to_examine, next_to_examine, checkpoint;
@@ -1467,7 +1467,7 @@ yylex (void)
while (next_to_examine <= last_to_examine)
{
- token_and_value next;
+ d_token_and_value next;
next = token_fifo[next_to_examine];
++next_to_examine;
@@ -1531,7 +1531,7 @@ yylex (void)
while (next_to_examine <= last_to_examine)
{
- token_and_value next;
+ d_token_and_value next;
next = token_fifo[next_to_examine];
++next_to_examine;