From 57ebc9901305133000100fa7764dac94b4208a3b Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Tue, 10 May 2022 08:47:34 -0600 Subject: [PATCH] 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 --- 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 -- 2.30.2