]> Savannah Git Hosting - gnulib.git/commitdiff
xstrtoimax, xstrtoumax: depend on inttypes-incomplete
authorPaul Eggert <eggert@cs.ucla.edu>
Mon, 24 Jan 2022 05:07:39 +0000 (21:07 -0800)
committerBruno Haible <bruno@clisp.org>
Wed, 31 Aug 2022 22:41:32 +0000 (00:41 +0200)
This fixes a call to strtoimax without declaring it,
and similarly for strtoumax.
* lib/xstrtoimax.c, lib/xstrtoumax.c (XSTRTOL_INCLUDE_INTTYPES_H):
Define, so that strtoimax and strtoumax are declared.
* lib/xstrtol.c [XSTRTOL_INCLUDE_INTTYPES_H]: Include inttypes.h.
* modules/xstrtoimax, modules/xstrtoumax (Depends-on):
Add inttypes-incomplete.

ChangeLog
lib/xstrtoimax.c
lib/xstrtol.c
lib/xstrtoumax.c
modules/xstrtoimax
modules/xstrtoumax

index 0b85270dd0f0e8c13a882f1fb929907cd8c04bd4..c08b6fd43e71eb21a76d52ba7ceb6d751d479bd1 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2022-01-23  Paul Eggert  <eggert@cs.ucla.edu>
+
+       xstrtoimax, xstrtoumax: depend on inttypes-incomplete
+       This fixes a call to strtoimax without declaring it,
+       and similarly for strtoumax.
+       * lib/xstrtoimax.c, lib/xstrtoumax.c (XSTRTOL_INCLUDE_INTTYPES_H):
+       Define, so that strtoimax and strtoumax are declared.
+       * lib/xstrtol.c [XSTRTOL_INCLUDE_INTTYPES_H]: Include inttypes.h.
+       * modules/xstrtoimax, modules/xstrtoumax (Depends-on):
+       Add inttypes-incomplete.
+
 2022-01-15  Bruno Haible  <bruno@clisp.org>
 
        log tests: Avoid test failure with nvc 22.1.
index 786be8c2103b900fc37e4a2b8159db99afa7316f..469d669c36ab46d8b41abbbfbeb0ab6dd6a4ac52 100644 (file)
@@ -20,4 +20,5 @@
 #define __xstrtol xstrtoimax
 #define STRTOL_T_MINIMUM INTMAX_MIN
 #define STRTOL_T_MAXIMUM INTMAX_MAX
+#define XSTRTOL_INCLUDE_INTTYPES_H 1
 #include "xstrtol.c"
index 5b8890edce5a2e1e4bbf3bfd24de24ba9e5b6ad3..207f9339fe7dd9e7bfe5ba580526f6ee3804356e 100644 (file)
 #include <stdlib.h>
 #include <string.h>
 
+#if XSTRTOL_INCLUDE_INTTYPES_H
+# include <inttypes.h>
+#endif
+
 #include "assure.h"
 
 #define TYPE_SIGNED(t) (! ((t) 0 < (t) -1))
index 1f4f04c324cca46057d2478ede6368dfe98babc9..88beca1086726c38bc28d4a6ce041a17c1f6b81f 100644 (file)
@@ -20,4 +20,5 @@
 #define __xstrtol xstrtoumax
 #define STRTOL_T_MINIMUM 0
 #define STRTOL_T_MAXIMUM UINTMAX_MAX
+#define XSTRTOL_INCLUDE_INTTYPES_H 1
 #include "xstrtol.c"
index 3ab6623027c9ffce89aca4f2f1a35690e86d897f..42de8b00ab38c0b6e564cea43bd25fd53a34e764 100644 (file)
@@ -6,6 +6,7 @@ lib/xstrtoimax.c
 
 Depends-on:
 xstrtol
+inttypes-incomplete
 strtoimax
 
 configure.ac:
index 0d8ad36f646cc708f7f84d1087a4e5899a838a29..a70dcd0d2f23c768f25d51797a4d35cf1f58d923 100644 (file)
@@ -6,6 +6,7 @@ lib/xstrtoumax.c
 
 Depends-on:
 xstrtol
+inttypes-incomplete
 strtoumax
 
 configure.ac: