public inbox for gdb-cvs@sourceware.org
help / color / mirror / Atom feed
* [binutils-gdb] Fix ODR warning in observable.h
@ 2022-06-02 15:28 Tom Tromey
  0 siblings, 0 replies; only message in thread
From: Tom Tromey @ 2022-06-02 15:28 UTC (permalink / raw)
  To: gdb-cvs

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=57ebc9901305133000100fa7764dac94b4208a3b

commit 57ebc9901305133000100fa7764dac94b4208a3b
Author: Tom Tromey <tromey@adacore.com>
Date:   Tue May 10 08:47:34 2022 -0600

    Fix ODR warning in observable.h
    
    observable.h triggers an ODR warning because this line:
    
        extern observable<struct target_ops */* target */> target_changed;
    
    ... 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.
    
    This patch fixes the problem by adding a forward declaration.
    
    Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=22395

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;
 
 namespace gdb


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-06-02 15:28 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-02 15:28 [binutils-gdb] Fix ODR warning in observable.h Tom Tromey

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).