From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2126) id 1A8303857359; Thu, 2 Jun 2022 15:29:34 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1A8303857359 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Tom Tromey To: gdb-cvs@sourceware.org Subject: [binutils-gdb] ODR warning for "enum string_repr_result" X-Act-Checkin: binutils-gdb X-Git-Author: Tom Tromey X-Git-Refname: refs/heads/master X-Git-Oldrev: ddfc4ef12441bef95ea0bf0a2fb68fe58e24440a X-Git-Newrev: cec000ad603ea768f5c1a6cf032770eb2d468337 Message-Id: <20220602152934.1A8303857359@sourceware.org> Date: Thu, 2 Jun 2022 15:29:34 +0000 (GMT) X-BeenThere: gdb-cvs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Jun 2022 15:29:34 -0000 https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3Dcec000ad603e= a768f5c1a6cf032770eb2d468337 commit cec000ad603ea768f5c1a6cf032770eb2d468337 Author: Tom Tromey Date: Wed May 18 09:55:00 2022 -0600 ODR warning for "enum string_repr_result" =20 "enum string_repr_result" is defined in multiple .c files, causing ODR warnings. This patch renames the types. =20 Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=3D22395 Diff: --- 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 @@ =20 /* Return type of print_string_repr. */ =20 -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 exceptio= n, /* Helper for gdbscm_apply_val_pretty_printer which calls to_string and formats the result. */ =20 -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 =3D NULL; SCM str_scm; - enum string_repr_result result =3D STRING_REPR_ERROR; + enum guile_string_repr_result result =3D STRING_REPR_ERROR; =20 str_scm =3D 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 =3D SCM_BOOL_F; enum display_hint hint; enum ext_lang_rc result =3D EXT_LANG_RC_NOP; - enum string_repr_result print_result; + enum guile_string_repr_result print_result; =20 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 @@ =20 /* Return type of print_string_repr. */ =20 -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. */ =20 -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 =3D NULL; - enum string_repr_result result =3D string_repr_ok; + enum gdbpy_string_repr_result result =3D string_repr_ok; =20 gdbpy_ref<> py_str =3D pretty_print_one_value (printer, &replacement); if (py_str !=3D NULL) @@ -572,7 +572,7 @@ gdbpy_apply_val_pretty_printer (const struct extension_= language_defn *extlang, { struct type *type =3D value_type (value); struct gdbarch *gdbarch =3D type->arch (); - enum string_repr_result print_result; + enum gdbpy_string_repr_result print_result; =20 if (value_lazy (value)) value_fetch_lazy (value);