From ba8a43c24dcfd5b76e986fd71275f1093e0b9813 Mon Sep 17 00:00:00 2001 From: Collin Funk Date: Wed, 1 May 2024 14:15:56 +0100 Subject: [PATCH] maint: pacify GCC 14 -Wmissing-variable-declarations * src/local.mk: Include extern decl for 'Version'. * src/crctab.c (crctab): Add an extern decl. * src/cksum.c: Generate an extern decl. --- src/cksum.c | 3 ++- src/crctab.c | 1 + src/local.mk | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/cksum.c b/src/cksum.c index a47450be1e..d93ec6e575 100644 --- a/src/cksum.c +++ b/src/cksum.c @@ -118,7 +118,8 @@ main (void) printf ("#include \n"); printf ("#include \n"); - printf ("\nuint_fast32_t const crctab[8][256] = {\n"); + printf ("\nextern uint_fast32_t const crctab[8][256];\n"); + printf ("uint_fast32_t const crctab[8][256] = {\n"); for (int y = 0; y < 8; y++) { printf ("{\n 0x%08x", crctab[y][0]); diff --git a/src/crctab.c b/src/crctab.c index fdf2fdf87c..f9f82ef3c2 100644 --- a/src/crctab.c +++ b/src/crctab.c @@ -1,6 +1,7 @@ #include #include +extern uint_fast32_t const crctab[8][256]; uint_fast32_t const crctab[8][256] = { { 0x00000000, diff --git a/src/local.mk b/src/local.mk index 96ee941ca5..afae90753f 100644 --- a/src/local.mk +++ b/src/local.mk @@ -633,6 +633,7 @@ src/version.c: Makefile $(AM_V_GEN)rm -f $@ $(AM_V_at)${MKDIR_P} src $(AM_V_at)printf '#include \n' > $@t + $(AM_V_at)printf '#include "version.h"\n' >> $@t $(AM_V_at)printf 'char const *Version = "$(PACKAGE_VERSION)";\n' >> $@t $(AM_V_at)chmod a-w $@t $(AM_V_at)mv $@t $@ -- 2.47.2