From 1256fb0925c5ff7c94249f53e0fb47d1ec280b3f Mon Sep 17 00:00:00 2001 From: Janneke Nieuwenhuizen Date: Fri, 6 Dec 2024 16:18:13 +0100 Subject: [PATCH] Silence GC warnings on the Hurd. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On 32-bit GNU/Hurd (i586-gnu), libgc emits "Repeated allocation" warnings that are annoying and interfere with communications between 'guix-daemon' and 'guix authenticate': . * libguile/gc.c (scm_gc_no_warnings)[__GNU__]: New procedure. (scm_init_gc)[__GNU__]: Use it to silence GC warnings. Co-authored-by: Ludovic Courtès --- libguile/gc.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/libguile/gc.c b/libguile/gc.c index 3cbe43ec5..1ea4abcf8 100644 --- a/libguile/gc.c +++ b/libguile/gc.c @@ -84,6 +84,13 @@ int scm_debug_cells_gc_interval = 0; garbage collection. */ static SCM scm_protects; +#if defined __GNU__ +#include +static void +scm_gc_no_warnings (char *message, GC_word arg) +{ +} +#endif @@ -616,7 +623,15 @@ scm_init_gc () scm_c_hook_add (&scm_after_gc_c_hook, accumulate_gc_timer, NULL, 0); GC_set_oom_fn (scm_oom_fn); +#if __GNU__ + /* XXX: On 32-bit GNU/Hurd (i586-gnu), libgc emits "Repeated allocation" + warnings that are annoying and interfere with communications between + 'guix-daemon' and 'guix authenticate': + . Silence them. */ + GC_set_warn_proc (scm_gc_no_warnings); +#else GC_set_warn_proc (scm_gc_warn_proc); +#endif GC_set_start_callback (run_before_gc_c_hook); #include "gc.x" -- 2.46.0