]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
maint: pacify GCC 14 -Wmissing-variable-declarations
authorCollin Funk <collin.funk1@gmail.com>
Wed, 1 May 2024 13:15:56 +0000 (14:15 +0100)
committerPádraig Brady <P@draigBrady.com>
Wed, 1 May 2024 13:37:18 +0000 (14:37 +0100)
* 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
src/crctab.c
src/local.mk

index a47450be1e38236b1ef9410bbae0191a84592535..d93ec6e575fd81070bc761a2d0be74dd79a0daca 100644 (file)
@@ -118,7 +118,8 @@ main (void)
 
   printf ("#include <config.h>\n");
   printf ("#include <stdint.h>\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]);
index fdf2fdf87cbd051f4ddd702add785c70de276965..f9f82ef3c27c70887a765cd2a329996907d7b3b3 100644 (file)
@@ -1,6 +1,7 @@
 #include <config.h>
 #include <stdint.h>
 
+extern uint_fast32_t const crctab[8][256];
 uint_fast32_t const crctab[8][256] = {
 {
   0x00000000,
index 96ee941ca521487726c1f1a0c8baccd416424076..afae90753fbbf1b27ac6aade5b8d083d72061fa2 100644 (file)
@@ -633,6 +633,7 @@ src/version.c: Makefile
        $(AM_V_GEN)rm -f $@
        $(AM_V_at)${MKDIR_P} src
        $(AM_V_at)printf '#include <config.h>\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 $@