Skip to content

Commit

Permalink
Eliminate 'unused const variable' Clang warning for copyright and ver…
Browse files Browse the repository at this point in the history
…sion

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.
  • Loading branch information
ivmai committed Mar 1, 2018
1 parent f30a26d commit 0b5f51b
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions alloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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. ",
Expand All @@ -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
Expand Down

0 comments on commit 0b5f51b

Please sign in to comment.