From: Tom Tromey Date: Tue, 10 May 2022 14:47:34 +0000 (-0600) Subject: Fix ODR warning in observable.h X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=57ebc9901305133000100fa7764dac94b4208a3b;p=binutils-gdb.git Fix ODR warning in observable.h observable.h triggers an ODR warning because this line: extern observable 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 --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