From a1537331abaf66fddd3553dd827381a01bcda46c Mon Sep 17 00:00:00 2001 From: Guinevere Larsen Date: Thu, 24 Apr 2025 08:42:12 -0300 Subject: [PATCH] gdb: fix 32 bit build The recent commit dbbb9cfd3708a5b09b449c6cbc4d74dfec13904d added a message using %ld to print an std::vector::size, which is of size_t type. on 64 bit machines, size_t will be an unsigned long int, making %ld work just fine, but on 32 bit ones, size_t will be unsigned int, which causes the build to fail. This commit fixes that by using %zu instead. Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=32901 Tested-By: Luis Machado Approved-By: Luis Machado --- gdb/solib.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gdb/solib.c b/gdb/solib.c index 5c5cfbdd9b9..85ec6bb2f1e 100644 --- a/gdb/solib.c +++ b/gdb/solib.c @@ -1230,7 +1230,7 @@ info_linker_namespace_command (const char *pattern, int from_tty) break; } uiout->message - (_ ("There are %ld libraries loaded in linker namespace [[%d]]\n"), + (_ ("There are %zu libraries loaded in linker namespace [[%d]]\n"), solibs_to_print.size (), ns); uiout->message (_ ("Displaying libraries for linker namespace [[%d]]:\n"), ns); -- 2.39.5