[Bug guile/28994] [build] Werror=deprecated-declarations for scm_install_gmp_memory_functions
vries at gcc dot gnu.org
sourceware-bugzilla@sourceware.org
Wed Jul 6 15:16:29 GMT 2022
https://sourceware.org/bugzilla/show_bug.cgi?id=28994
--- Comment #7 from Tom de Vries <vries at gcc dot gnu.org> ---
(In reply to Ludovic Courtès from comment #6)
> (In reply to Tom de Vries from comment #5)
> > Once more noted at
> > https://sourceware.org/pipermail/gdb-patches/2022-July/190524.html .
>
> As suggested earlier, how about something along these lines:
>
> /* This variable is deprecated in Guile 3.0.8 and later but remains
> available in the whole 3.0 series. */
> #pragma GCC diagnostic push
> #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
> scm_install_gmp_memory_functions = 0;
> #pragma GCC diagnostic pop
>
> If that's fine with you, I'd prefer to let you check this in as I'm lacking
> the bandwidth to do more currently.
Works for me.
I've also added a test on SCM_MAJOR/MINOR_VERSION to make sure we don't run
into trouble once the variable is removed:
...
diff --git a/gdb/guile/guile.c b/gdb/guile/guile.c
index 14b191ded62..e5565b627d9 100644
--- a/gdb/guile/guile.c
+++ b/gdb/guile/guile.c
@@ -677,7 +677,17 @@ gdbscm_initialize (const struct extension_language_defn
*ext
lang)
"double free or corruption (out)" error.
Work around the libguile bug by disabling the installation of the
libgmp memory functions by guile initialization. */
+
+ /* The scm_install_gmp_memory_functions variable should be removed after
+ version 3.0, so limit usage to 3.0 and before. */
+#if SCM_MAJOR_VERSION < 3 || (SCM_MAJOR_VERSION == 3 && SCM_MINOR_VERSION == 0
)
+ /* This variable is deprecated in Guile 3.0.8 and later but remains
+ available in the whole 3.0 series. */
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
scm_install_gmp_memory_functions = 0;
+#pragma GCC diagnostic pop
+#endif-
/* scm_with_guile is the most portable way to initialize Guile. Plus
we need to initialize the Guile support while in Guile mode (e.g.,
...
WDYT?
--
You are receiving this mail because:
You are on the CC list for the bug.
More information about the Gdb-prs
mailing list