Eliminate 'unused variable old_maps_size' compiler warning in get_maps
authorIvan Maidanski <ivmai@mail.ru>
Fri, 31 Aug 2018 20:06:56 +0000 (23:06 +0300)
committerIvan Maidanski <ivmai@mail.ru>
Fri, 31 Aug 2018 20:06:56 +0000 (23:06 +0300)
(fix of commit b3eee14)

* os_dep.c [NEED_PROC_MAPS] (GC_get_maps): Do not declare old_maps_size
local variable unless THREADS.

os_dep.c

index f0b2bb6..bf089e8 100644 (file)
--- a/os_dep.c
+++ b/os_dep.c
@@ -172,7 +172,10 @@ GC_INNER char * GC_get_maps(void)
     ssize_t result;
     static char *maps_buf = NULL;
     static size_t maps_buf_sz = 1;
-    size_t maps_size, old_maps_size = 0;
+    size_t maps_size;
+#   ifdef THREADS
+      size_t old_maps_size = 0;
+#   endif
 
     /* The buffer is essentially static, so there must be a single client. */
     GC_ASSERT(I_HOLD_LOCK());