From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2126) id 826BB3857BAD; Thu, 2 Jun 2022 15:28:53 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 826BB3857BAD 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] Fix ODR warning in observable.h X-Act-Checkin: binutils-gdb X-Git-Author: Tom Tromey X-Git-Refname: refs/heads/master X-Git-Oldrev: 2e90d0257855fa4661f2da67033286958632ed55 X-Git-Newrev: 57ebc9901305133000100fa7764dac94b4208a3b Message-Id: <20220602152853.826BB3857BAD@sourceware.org> Date: Thu, 2 Jun 2022 15:28:53 +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:28:53 -0000 https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3D57ebc9901305= 133000100fa7764dac94b4208a3b commit 57ebc9901305133000100fa7764dac94b4208a3b Author: Tom Tromey Date: Tue May 10 08:47:34 2022 -0600 Fix ODR warning in observable.h =20 observable.h triggers an ODR warning because this line: =20 extern observable target_changed; =20 ... may be the only declaration of "struct target_ops" in scope (depending on the particular .c file) -- and this declares it in a namespace, resulting in confusion. =20 This patch fixes the problem by adding a forward declaration. =20 Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=3D22395 Diff: --- gdb/observable.h | 1 + 1 file changed, 1 insertion(+) diff --git a/gdb/observable.h b/gdb/observable.h index f426c1a761f..796bf2a43c6 100644 --- a/gdb/observable.h +++ b/gdb/observable.h @@ -28,6 +28,7 @@ struct objfile; struct thread_info; struct inferior; struct process_stratum_target; +struct target_ops; struct trace_state_variable; =20 namespace gdb