From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-io1-xd2d.google.com (mail-io1-xd2d.google.com [IPv6:2607:f8b0:4864:20::d2d]) by sourceware.org (Postfix) with ESMTPS id C716538515F3 for ; Wed, 18 May 2022 18:01:02 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org C716538515F3 Received: by mail-io1-xd2d.google.com with SMTP id a10so3138764ioe.9 for ; Wed, 18 May 2022 11:01:02 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=xyZ2ZzpBvaNyBCAkefka+Pol1ioUPmvLT96L+VRDNvc=; b=fnGhITVIuf1BkixikoeoBmDzgyyg9bootd6uN5bwKpzixH7eNtVDbGydZze7RTdgRs GA6IQlNc0rSsrxFpdQF3/CCyT9HQLnaNtcuV3OaodikXyj9dmQw4C1NNZZLcStekNBvi +a4l0N73knlWWhZwyoMHq+FqnSt8lxnR5aGnXuaZZkKi9UlLeKqr/IaP7deeT3EZU1Kx w7Mgb0gv/Tcb2C8OI/gyq7rv50guKRCNnMq54MWvJv3rAl+Pw3Xv0j3AADS2lK0YSpgH j+7mnIOcKfO1qQUieykAKS0w7gLFPkewG/cv1MsZqPeeuRaMHcvZ9nAiyOEdv75zlFSO skmg== X-Gm-Message-State: AOAM5313pumt3vUHdOHbtYnx0fII7qF2EDdGnQ2NgJRkVlGWcswrgk/y m74gLnZZJF0lLC5CcMHYR1dSOGoPnA/bkw== X-Google-Smtp-Source: ABdhPJyPR8BZHTWUeHS390VEKv8KvxWNClAMlQAe0xyw76lf4clAE3CGhyO2crn5er2as5hZDvBL4Q== X-Received: by 2002:a05:6638:1614:b0:32e:41f6:2988 with SMTP id x20-20020a056638161400b0032e41f62988mr415703jas.144.1652896862059; Wed, 18 May 2022 11:01:02 -0700 (PDT) Received: from murgatroyd.Home (71-211-158-194.hlrn.qwest.net. [71.211.158.194]) by smtp.gmail.com with ESMTPSA id r4-20020a92d984000000b002cde6e352ffsm715083iln.73.2022.05.18.11.01.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 May 2022 11:01:01 -0700 (PDT) From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [PATCH 09/14] ODR warning for "enum string_repr_result" Date: Wed, 18 May 2022 12:00:44 -0600 Message-Id: <20220518180049.2337257-10-tromey@adacore.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220518180049.2337257-1-tromey@adacore.com> References: <20220518180049.2337257-1-tromey@adacore.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-11.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 May 2022 18:01:04 -0000 "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