Skip to content

Commit 89a103e

Browse files
committed
Clean missing-variable-declarations warnings
Add __attribute__((used)) and static qualifier to copyright strings in deflate.c, inftrees.c, zip.c, unzip.c, and inftree9.c to resolve missing-variable-declarations compiler warnings for gcc and clang while preserving copyright strings in compiled binaries.
1 parent 75133f8 commit 89a103e

File tree

5 files changed

+22
-2
lines changed

5 files changed

+22
-2
lines changed

contrib/infback9/inftree9.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@
88

99
#define MAXBITS 15
1010

11+
#ifdef __GNUC__
12+
__attribute__((used))
13+
static
14+
#endif
1115
const char inflate9_copyright[] =
1216
" inflate9 1.3.1.2 Copyright 1995-2025 Mark Adler ";
1317
/*

contrib/minizip/unzip.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,10 @@
109109
#define SIZECENTRALDIRITEM (0x2e)
110110
#define SIZEZIPLOCALHEADER (0x1e)
111111

112-
112+
#ifdef __GNUC__
113+
__attribute__((used))
114+
static
115+
#endif
113116
const char unz_copyright[] =
114117
" unzip 1.01 Copyright 1998-2004 Gilles Vollant - http://www.winimage.com/zLibDll";
115118

contrib/minizip/zip.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,12 @@
9393
# define DEF_MEM_LEVEL MAX_MEM_LEVEL
9494
#endif
9595
#endif
96-
const char zip_copyright[] =" zip 1.01 Copyright 1998-2004 Gilles Vollant - http://www.winimage.com/zLibDll";
96+
#ifdef __GNUC__
97+
__attribute__((used))
98+
static
99+
#endif
100+
const char zip_copyright[] =
101+
" zip 1.01 Copyright 1998-2004 Gilles Vollant - http://www.winimage.com/zLibDll";
97102

98103

99104
#define SIZEDATA_INDATABLOCK (4096-(4*4))

deflate.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,10 @@
5151

5252
#include "deflate.h"
5353

54+
#ifdef __GNUC__
55+
__attribute__((used))
56+
static
57+
#endif
5458
const char deflate_copyright[] =
5559
" deflate 1.3.1.2 Copyright 1995-2025 Jean-loup Gailly and Mark Adler ";
5660
/*

inftrees.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@
1818

1919
#define MAXBITS 15
2020

21+
#ifdef __GNUC__
22+
__attribute__((used))
23+
static
24+
#endif
2125
const char inflate_copyright[] =
2226
" inflate 1.3.1.2 Copyright 1995-2025 Mark Adler ";
2327
/*

0 commit comments

Comments
 (0)