From: Paul Eggert Date: Fri, 17 May 2024 04:06:58 +0000 (-0700) Subject: cksum: improve API consistency checking X-Git-Tag: v9.6~234 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=44084a3ac216b7a53cdf78a9361010c084fc0535;p=thirdparty%2Fcoreutils.git cksum: improve API consistency checking * src/cksum.c (main) [CRCTAB]: Generate updated crctab.c (see below). * src/crctab.c: Include cksum.h, to check consistency between decl and defn. Include stdio.h since cksum.h needs it. --- diff --git a/src/cksum.c b/src/cksum.c index d93ec6e575..ca67755394 100644 --- a/src/cksum.c +++ b/src/cksum.c @@ -25,7 +25,7 @@ do something like the following: cc -I../lib -DCRCTAB -o crctab cksum.c - crctab > crctab.c + ./crctab > crctab.c This software is compatible with neither the System V nor the BSD 'sum' program. It is supposed to conform to POSIX, except perhaps @@ -118,7 +118,9 @@ main (void) printf ("#include \n"); printf ("#include \n"); - printf ("\nextern uint_fast32_t const crctab[8][256];\n"); + printf ("#include \n"); + printf ("#include \"cksum.h\"\n"); + printf ("\n"); printf ("uint_fast32_t const crctab[8][256] = {\n"); for (int y = 0; y < 8; y++) { diff --git a/src/crctab.c b/src/crctab.c index f9f82ef3c2..bf5d884bf7 100644 --- a/src/crctab.c +++ b/src/crctab.c @@ -1,7 +1,8 @@ #include #include +#include +#include "cksum.h" -extern uint_fast32_t const crctab[8][256]; uint_fast32_t const crctab[8][256] = { { 0x00000000,