Hi Ciaran and respected community members, Thank you for reaching out. >I did have success with the following (pasted) patch, so I can submit that >properly if it isn't going to break anything for the AIX build, but also >open to other suggestions. GDB in AIX builds successfully with the patch you pasted in the previous email. We are okay with the fix. Kindly let us know if you want to check anything else in AIX operating system. Have a nice day ahead. Thanks and regards, Aditya. From: Ciaran Woodward Date: Tuesday, 6 February 2024 at 6:07 PM To: Aditya Kamath1 , Tom Tromey Cc: Tom Tromey , Ulrich Weigand , Sangamesh Mallayya , Aditya Kamath1 via Gdb-patches Subject: [EXTERNAL] RE: [PATCH] Fix AIX build break. > +/* A function that can be used to intercept warnings. */ > +typedef void (*warning_hook_handler) (const char *, va_list); > + > +/* Set the thread-local warning hook, and restore the old value when > + finished. */ > +class scoped_restore_warning_hook > +{ > +public: > + explicit scoped_restore_warning_hook (warning_hook_handler new_handler); > + > +private: > + scoped_restore_tmpl m_save; > +}; This part of the patch seems to have broken the build on mingw-64 gcc 13.2.0. I think it is because va_list on that platform has some attributes. Example (Werror) warning: In file included from ../../gdb/defs.h:620, from ../../gdb/x86-tdep.c:20: ../../gdb/utils.h:387:43: error: ignoring attributes on template argument 'warning_hook_handler' {aka 'void (*)(const char*, char*)'} [-Werror=ignored-attributes] 387 | scoped_restore_tmpl m_save; | ^ I'm not sure what the 'best' solution is, as we don't really care about the type attributes in this context, as we're just saving and restoring it. I did have success with the following (pasted) patch, so I can submit that properly if it isn't going to break anything for the AIX build, but also open to other suggestions. """""" diff --git a/gdb/utils.c b/gdb/utils.c index 702c3f15826..9d8a6443b37 100644 --- a/gdb/utils.c +++ b/gdb/utils.c @@ -145,7 +145,8 @@ get_warning_hook_handler () scoped_restore_warning_hook::scoped_restore_warning_hook (warning_hook_handler new_handler) - : m_save (make_scoped_restore (&warning_hook, new_handler)) + : m_save (make_scoped_restore (reinterpret_cast(&warning_hook), + reinterpret_cast(new_handler))) { } diff --git a/gdb/utils.h b/gdb/utils.h index 7487590902a..bea19369b9b 100644 --- a/gdb/utils.h +++ b/gdb/utils.h @@ -384,7 +384,7 @@ class scoped_restore_warning_hook explicit scoped_restore_warning_hook (warning_hook_handler new_handler); private: - scoped_restore_tmpl m_save; + scoped_restore_tmpl m_save; }; /* Return the current warning handler. */ """""" Cheers, Ciaran