aboutsummaryrefslogtreecommitdiff
path: root/gdb/f-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
commite72b937dddaf24d99ec1bf3beda4d8ecf3cd368c (patch)
tree5911a0ca086259e6be525b3e393cf8fe6a80747a /gdb/f-exp.y
parent9972aac27d5d664a29abc88acd3a84c1e72064c4 (diff)
downloadfsf-binutils-gdb-e72b937dddaf24d99ec1bf3beda4d8ecf3cd368c.zip
fsf-binutils-gdb-e72b937dddaf24d99ec1bf3beda4d8ecf3cd368c.tar.gz
fsf-binutils-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/f-exp.y')
-rw-r--r--gdb/f-exp.y8
1 files changed, 4 insertions, 4 deletions
diff --git a/gdb/f-exp.y b/gdb/f-exp.y
index 19e4c70..18566af 100644
--- a/gdb/f-exp.y
+++ b/gdb/f-exp.y
@@ -1219,7 +1219,7 @@ convert_to_kind_type (struct type *basetype, int kind)
return nullptr;
}
-struct token
+struct f_token
{
/* The string to match against. */
const char *oper;
@@ -1237,7 +1237,7 @@ struct token
/* List of Fortran operators. */
-static const struct token fortran_operators[] =
+static const struct f_token fortran_operators[] =
{
{ ".and.", BOOL_AND, OP_NULL, false },
{ ".or.", BOOL_OR, OP_NULL, false },
@@ -1278,7 +1278,7 @@ static const struct f77_boolean_val boolean_values[] =
{ ".false.", 0 }
};
-static const struct token f_intrinsics[] =
+static const struct f_token f_intrinsics[] =
{
/* The following correspond to actual functions in Fortran and are case
insensitive. */
@@ -1300,7 +1300,7 @@ static const struct token f_intrinsics[] =
{ "sizeof", SIZEOF, OP_NULL, false },
};
-static const token f_keywords[] =
+static const f_token f_keywords[] =
{
/* Historically these have always been lowercase only in GDB. */
{ "character", CHARACTER, OP_NULL, true },