diff options
author | Tom de Vries <tdevries@suse.de> | 2023-08-14 18:32:29 +0200 |
---|---|---|
committer | Tom de Vries <tdevries@suse.de> | 2023-08-14 18:32:29 +0200 |
commit | e72b937dddaf24d99ec1bf3beda4d8ecf3cd368c (patch) | |
tree | 5911a0ca086259e6be525b3e393cf8fe6a80747a /gdb/c-exp.y | |
parent | 9972aac27d5d664a29abc88acd3a84c1e72064c4 (diff) | |
download | gdb-e72b937dddaf24d99ec1bf3beda4d8ecf3cd368c.zip gdb-e72b937dddaf24d99ec1bf3beda4d8ecf3cd368c.tar.gz gdb-e72b937dddaf24d99ec1bf3beda4d8ecf3cd368c.tar.bz2 |
[gdb/build] Fix struct token odr violation
When building gdb with -O2 -flto I run into:
...
/data/vries/gdb/src/gdb/c-exp.y:2450:8: warning: type 'struct token' \
violates the C++ One Definition Rule [-Wodr]
struct token
^
/data/vries/gdb/src/gdb/d-exp.y:939:8: note: a different type is defined in \
another translation unit
struct token
^
...
Fix this by renaming to c_token and d_token.
Likewise in:
- fortran-exp.y, renaming to f_token,
- go-exp.y, renaming to go_token, and
- p-exp.y, renaming to p_token.
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/c-exp.y')
-rw-r--r-- | gdb/c-exp.y | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/gdb/c-exp.y b/gdb/c-exp.y index 032ba25..a27dbfa 100644 --- a/gdb/c-exp.y +++ b/gdb/c-exp.y @@ -2447,7 +2447,7 @@ enum token_flag }; DEF_ENUM_FLAGS_TYPE (enum token_flag, token_flags); -struct token +struct c_token { const char *oper; int token; @@ -2455,7 +2455,7 @@ struct token token_flags flags; }; -static const struct token tokentab3[] = +static const struct c_token tokentab3[] = { {">>=", ASSIGN_MODIFY, BINOP_RSH, 0}, {"<<=", ASSIGN_MODIFY, BINOP_LSH, 0}, @@ -2463,7 +2463,7 @@ static const struct token tokentab3[] = {"...", DOTDOTDOT, OP_NULL, 0} }; -static const struct token tokentab2[] = +static const struct c_token tokentab2[] = { {"+=", ASSIGN_MODIFY, BINOP_ADD, 0}, {"-=", ASSIGN_MODIFY, BINOP_SUB, 0}, @@ -2494,7 +2494,7 @@ static const struct token tokentab2[] = multi-word type names (for example 'double' can appear in 'long double') need to be listed here. type-specifiers that are only ever single word (like 'char') are handled by the classify_name function. */ -static const struct token ident_tokens[] = +static const struct c_token ident_tokens[] = { {"unsigned", UNSIGNED, OP_NULL, 0}, {"template", TEMPLATE, OP_NULL, FLAG_CXX}, |