From: Tom Tromey <tromey@adacore.com>
To: gdb-patches@sourceware.org
Cc: Tom Tromey <tromey@adacore.com>
Subject: [PATCH 09/14] ODR warning for "enum string_repr_result"
Date: Wed, 18 May 2022 12:00:44 -0600 [thread overview]
Message-ID: <20220518180049.2337257-10-tromey@adacore.com> (raw)
In-Reply-To: <20220518180049.2337257-1-tromey@adacore.com>
"enum string_repr_result" is defined in multiple .c files, causing ODR
warnings. This patch renames the types.
Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=22395
---
gdb/guile/scm-pretty-print.c | 8 ++++----
gdb/python/py-prettyprint.c | 8 ++++----
2 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/gdb/guile/scm-pretty-print.c b/gdb/guile/scm-pretty-print.c
index 2bb63e849d1..e2bc19820d7 100644
--- a/gdb/guile/scm-pretty-print.c
+++ b/gdb/guile/scm-pretty-print.c
@@ -31,7 +31,7 @@
/* Return type of print_string_repr. */
-enum string_repr_result
+enum guile_string_repr_result
{
/* The string method returned None. */
STRING_REPR_NONE,
@@ -638,7 +638,7 @@ ppscm_print_exception_unless_memory_error (SCM exception,
/* Helper for gdbscm_apply_val_pretty_printer which calls to_string and
formats the result. */
-static enum string_repr_result
+static enum guile_string_repr_result
ppscm_print_string_repr (SCM printer, enum display_hint hint,
struct ui_file *stream, int recurse,
const struct value_print_options *options,
@@ -647,7 +647,7 @@ ppscm_print_string_repr (SCM printer, enum display_hint hint,
{
struct value *replacement = NULL;
SCM str_scm;
- enum string_repr_result result = STRING_REPR_ERROR;
+ enum guile_string_repr_result result = STRING_REPR_ERROR;
str_scm = ppscm_pretty_print_one_value (printer, &replacement,
gdbarch, language);
@@ -963,7 +963,7 @@ gdbscm_apply_val_pretty_printer (const struct extension_language_defn *extlang,
SCM val_obj = SCM_BOOL_F;
enum display_hint hint;
enum ext_lang_rc result = EXT_LANG_RC_NOP;
- enum string_repr_result print_result;
+ enum guile_string_repr_result print_result;
if (value_lazy (value))
value_fetch_lazy (value);
diff --git a/gdb/python/py-prettyprint.c b/gdb/python/py-prettyprint.c
index c9bbd726412..a25a1b65944 100644
--- a/gdb/python/py-prettyprint.c
+++ b/gdb/python/py-prettyprint.c
@@ -29,7 +29,7 @@
/* Return type of print_string_repr. */
-enum string_repr_result
+enum gdbpy_string_repr_result
{
/* The string method returned None. */
string_repr_none,
@@ -273,7 +273,7 @@ print_stack_unless_memory_error (struct ui_file *stream)
/* Helper for gdbpy_apply_val_pretty_printer which calls to_string and
formats the result. */
-static enum string_repr_result
+static enum gdbpy_string_repr_result
print_string_repr (PyObject *printer, const char *hint,
struct ui_file *stream, int recurse,
const struct value_print_options *options,
@@ -281,7 +281,7 @@ print_string_repr (PyObject *printer, const char *hint,
struct gdbarch *gdbarch)
{
struct value *replacement = NULL;
- enum string_repr_result result = string_repr_ok;
+ enum gdbpy_string_repr_result result = string_repr_ok;
gdbpy_ref<> py_str = pretty_print_one_value (printer, &replacement);
if (py_str != NULL)
@@ -572,7 +572,7 @@ gdbpy_apply_val_pretty_printer (const struct extension_language_defn *extlang,
{
struct type *type = value_type (value);
struct gdbarch *gdbarch = type->arch ();
- enum string_repr_result print_result;
+ enum gdbpy_string_repr_result print_result;
if (value_lazy (value))
value_fetch_lazy (value);
--
2.34.1
next prev parent reply other threads:[~2022-05-18 18:01 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-18 18:00 [PATCH 00/14] More ODR fixes Tom Tromey
2022-05-18 18:00 ` [PATCH 01/14] Fix ODR warning in observable.h Tom Tromey
2022-05-18 18:00 ` [PATCH 02/14] ODR warnings for struct symloc Tom Tromey
2022-05-18 18:00 ` [PATCH 03/14] ODR warnings for struct nextfield Tom Tromey
2022-05-18 18:00 ` [PATCH 04/14] ODR warning for struct field_info Tom Tromey
2022-05-18 18:00 ` [PATCH 05/14] ODR warning for struct ext_link_map Tom Tromey
2022-05-18 18:00 ` [PATCH 06/14] ODR warning for "struct instruction_type" Tom Tromey
2022-05-18 18:00 ` [PATCH 07/14] ODR warning for "struct stack_item" Tom Tromey
2022-05-18 18:00 ` [PATCH 08/14] ODR warning for "struct find_targ_sec_arg" Tom Tromey
2022-05-18 18:00 ` Tom Tromey [this message]
2022-05-18 18:00 ` [PATCH 10/14] ODR warnings from overlay constants Tom Tromey
2022-05-18 18:00 ` [PATCH 11/14] ODR warnings for "struct insn_info" Tom Tromey
2022-05-18 18:00 ` [PATCH 12/14] ODR warnings for "struct insn_decode_record_t" Tom Tromey
2022-05-18 18:00 ` [PATCH 13/14] ODR warnings for "struct coff_symbol" Tom Tromey
2022-05-18 18:00 ` [PATCH 14/14] ODR warning for "main" Tom Tromey
2022-06-02 15:28 ` [PATCH 00/14] More ODR fixes Tom Tromey
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220518180049.2337257-10-tromey@adacore.com \
--to=tromey@adacore.com \
--cc=gdb-patches@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).