From 0b5f51b60de5539b3915461ce1618a2cf921e7d5 Mon Sep 17 00:00:00 2001 From: Ivan Maidanski Date: Thu, 1 Mar 2018 11:44:07 +0300 Subject: [PATCH] Eliminate 'unused const variable' Clang warning for copyright and version Issue #206 (bdwgc). * alloc.c (GC_copyright): Declare (inside EXTERN_C_BEGIN/END) before the definition. * alloc.c [!GC_NO_VERSION_VAR] (GC_version): Likewise. --- alloc.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/alloc.c b/alloc.c index 43a7d24..abdfebe 100644 --- a/alloc.c +++ b/alloc.c @@ -115,6 +115,9 @@ STATIC GC_bool GC_need_full_gc = FALSE; STATIC word GC_used_heap_size_after_full = 0; /* GC_copyright symbol is externally visible. */ +EXTERN_C_BEGIN +extern const char * const GC_copyright[]; +EXTERN_C_END const char * const GC_copyright[] = {"Copyright 1988,1989 Hans-J. Boehm and Alan J. Demers ", "Copyright (c) 1991-1995 by Xerox Corporation. All rights reserved. ", @@ -127,6 +130,9 @@ const char * const GC_copyright[] = /* Version macros are now defined in gc_version.h, which is included by */ /* gc.h, which is included by gc_priv.h. */ #ifndef GC_NO_VERSION_VAR + EXTERN_C_BEGIN + extern const unsigned GC_version; + EXTERN_C_END const unsigned GC_version = ((GC_VERSION_MAJOR << 16) | (GC_VERSION_MINOR << 8) | GC_VERSION_MICRO); #endif -- 2.7.4