]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
build: fix _Noreturn compilation failure
authorPádraig Brady <P@draigBrady.com>
Mon, 10 Apr 2023 18:36:23 +0000 (19:36 +0100)
committerPádraig Brady <P@draigBrady.com>
Mon, 10 Apr 2023 18:45:14 +0000 (19:45 +0100)
Fix a build failure seen on gcc 3.4 on Solaris 10 at least.

* src/crctab.c: Ensure we include config.h for all compilation units.
This is now required for new _Noreturn usage in gnulib for stdint.h.
* src/cksum.c: Update generation code to ensure config.h included.
* cfg.mk: Remove crctab.c exclusion from the config.h check.

cfg.mk
src/cksum.c
src/crctab.c

diff --git a/cfg.mk b/cfg.mk
index 7c88d07497f0034a1add1b7821adfbc0f6443b7f..918c929e788f0e9406e0f89fdb19e0c1789b121a 100644 (file)
--- a/cfg.mk
+++ b/cfg.mk
@@ -844,7 +844,7 @@ exclude_file_name_regexp--sc_trailing_blank = \
 exclude_file_name_regexp--sc_system_h_headers = \
   ^src/((die|system|copy|chown-core|find-mount-point)\.h|make-prime-list\.c)$$
 
-_src = (crctab|false|lbracket|ls-(dir|ls|vdir)|tac-pipe|uname-(arch|uname))
+_src = (false|lbracket|ls-(dir|ls|vdir)|tac-pipe|uname-(arch|uname))
 _gl_src = (xdecto.max|cl-strtold)
 exclude_file_name_regexp--sc_require_config_h_first = \
   (^lib/buffer-lcm\.c|gl/lib/$(_gl_src)\.c|src/$(_src)\.c)$$
index 5e38fef3a7ec864aa4ba0217bf799d8865f46e1f..75d82e62cae2ebf8ef25187199745d468e02ea51 100644 (file)
@@ -116,8 +116,9 @@ main (void)
         }
     }
 
-  printf ("#include <stdint.h>\n\n");
-  printf ("uint_fast32_t const crctab[8][256] = {\n");
+  printf ("#include <config.h>\n");
+  printf ("#include <stdint.h>\n");
+  printf ("\nuint_fast32_t const crctab[8][256] = {\n");
   for (int y = 0; y < 8; y++)
     {
       printf ("{\n  0x%08x", crctab[y][0]);
index 20a1e412778b62661b64d170fdc53a90ccaa5861..fdf2fdf87cbd051f4ddd702add785c70de276965 100644 (file)
@@ -1,3 +1,4 @@
+#include <config.h>
 #include <stdint.h>
 
 uint_fast32_t const crctab[8][256] = {