Respected Tom and community members, Hi, Please find attached a patch. (See: 0001-Fix-AIX-build-break.patch) Thank you for your feedback. >> +#include "warning-header.h" >This header has a static definition, but this means the symbol will be >created twice -- once at each include. However, this is wrong. Okay. Hmm. Can we use a function interface (If I can call so) defined in defs.h in this version of the patch by which any other files which needs the pointer to work with can access? >> +scoped_restore_warning_hook::scoped_restore_warning_hook (warning_hook_handler new_handler) >Line too long. >> +scoped_restore_warning_hook::~scoped_restore_warning_hook() >Space before '('. >> +class scoped_restore_warning_hook >> +{ >> + public: >Indentation here looks wrong I think? >> + private: >> + warning_hook_handler old_handler; >gdb convention is to name private members with "m_" prefix. Fixed all these in this version of the patch. >> +static void (*deprecated_warning_hook) (const char *, va_list); >> + >> +#endif >It's bad to define things in headers. There should be just a single >definition in a .c file, and this still has to be thread-local. Please check now. >> +{ >> + deprecated_warning_hook = old_handler; >> +} >This class can just wrap a scoped_restore. I did not get you. Looking around did you mean we should use something like scoped_restore pstate_restore = make_scoped_restore (&pstate);?? Kindly let me know what you think of this version of the patch. I am thankful for your patience while I learn how to solve this for GDB. Have a nice day ahead. Thanks and regards, Aditya. From: Tom Tromey Date: Friday, 26 January 2024 at 1:23 AM To: Aditya Kamath1 Cc: Tom Tromey , Ulrich Weigand , Sangamesh Mallayya , Aditya Kamath1 via Gdb-patches Subject: [EXTERNAL] Re: [PATCH] Fix AIX build break. >>>>> Aditya Kamath1 writes: > +#include "warning-header.h" This header has a static definition, but this means the symbol will be created twice -- once at each include. However, this is wrong. > + > +scoped_restore_warning_hook::scoped_restore_warning_hook (warning_hook_handler new_handler) Line too long. > +scoped_restore_warning_hook::~scoped_restore_warning_hook() Space before '('. > +{ > + deprecated_warning_hook = old_handler; > +} This class can just wrap a scoped_restore. > +class scoped_restore_warning_hook > +{ > + public: Indentation here looks wrong I think? > + private: > + warning_hook_handler old_handler; gdb convention is to name private members with "m_" prefix. > diff --git a/gdb/warning-header.h b/gdb/warning-header.h > new file mode 100644 > index 00000000000..14acf9bcb9b > --- /dev/null > +++ b/gdb/warning-header.h > @@ -0,0 +1,6 @@ > +#ifndef GDB_WARNING_HOOK > +#define GDB_WARNING_HOOK 1 > + > +static void (*deprecated_warning_hook) (const char *, va_list); > + > +#endif It's bad to define things in headers. There should be just a single definition in a .c file, and this still has to be thread-local. Tom