]> 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)
committerPaul Eggert <eggert@cs.ucla.edu>
Mon, 24 Jan 2022 05:08:07 +0000 (21:08 -0800)
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 980d214b8b5658eb0a0b53964e9f8011b3166a0d..fc4e46747b859cc9563548da08e3cb43b81e2362 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +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.
+
        alignalloc, xalignalloc: new modules
        * lib/alignalloc.c, lib/alignalloc.h, lib/xalignalloc.c:
        * m4/alignalloc.m4, modules/alignalloc, modules/alignalloc-tests:
index c7a8415b49f88bd184f1b7ba7bae859e9ca6bba7..f01d2d746af6da07a820f85cc4935f34ce55368d 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 3e2efb2a173ef3cea2cee7ac38c20a883308bbf0..e0a692ff2c038588cb8c098d6663c541f52f8148 100644 (file)
 #include <stdlib.h>
 #include <string.h>
 
+#if XSTRTOL_INCLUDE_INTTYPES_H
+# include <inttypes.h>
+#endif
+
 #include "assure.h"
 #include "intprops.h"
 
index fa437b4ff70f9e629bd87bb7f71bd55c2f7e8197..8f4feb60447bcf7c0382d18af8a1b395a3d24596 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: