From 929fd61c86fd49375ac78303e83bd6235d65691f Mon Sep 17 00:00:00 2001 From: Landon Curt Noll Date: Fri, 31 Oct 2025 19:02:17 -0700 Subject: [PATCH] Change `string_to_intmax()` and `string_to_uintmax()` to use `warn(3)` so that the `test_ioccc/txzchk_test.sh` from [the other repo](https://github.com/ioccc-src/mkiocccentry) won't trigger a test error due to system implementation differences with various `errno` values. Updated `JPARSE_REPO_VERSION` to "2.5.1 2025-10-31". Updated `JPARSE_UTILS_VERSION` to "2.1.6 2025-10-31". Ran `make release` to test the above. --- CHANGES.md | 12 ++++++++++++ util.c | 8 ++++---- version.h | 4 ++-- 3 files changed, 18 insertions(+), 6 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 5517ea9..0f105f5 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,6 +1,18 @@ # Significant changes in the JSON parser repo +## Release 2.5.1 2025-10-31 + +Change `string_to_intmax()` and `string_to_uintmax()` +to use `warn(3)` so that the `test_ioccc/txzchk_test.sh` +from [the other repo](https://github.com/ioccc-src/mkiocccentry) +won't trigger a test error due to system implementation +differences with various `errno` values. + +Updated `JPARSE_REPO_VERSION` to "2.5.1 2025-10-31". +Updated `JPARSE_UTILS_VERSION` to "2.1.6 2025-10-31". + + ## Release 2.5.0 2025-10-02 Added `#include` of `pr.h` and `dyn_array.h` in `jparse.h`. diff --git a/util.c b/util.c index f1ffd8b..7b3f0c2 100644 --- a/util.c +++ b/util.c @@ -175,7 +175,7 @@ string_to_intmax(char const *str, intmax_t *ret) /* * perform the conversion */ - errno = 0; /* pre-clear errno for warnp() */ + errno = 0; /* pre-clear errno */ num = strtoimax(str, &endptr, 10); saved_errno = errno; if (endptr == str) { @@ -186,7 +186,7 @@ string_to_intmax(char const *str, intmax_t *ret) return false; } else if (saved_errno != 0) { errno = saved_errno; - warnp(__func__, "error converting string \"%s\" to intmax_t", str); + warn(__func__, "error converting string \"%s\" to intmax_t", str); return false; } else if (num <= INTMAX_MIN || num >= INTMAX_MAX) { warn(__func__, "number %s out of range for intmax_t (must be > %jd && < %jd)", str, INTMAX_MIN, INTMAX_MAX); @@ -237,7 +237,7 @@ string_to_uintmax(char const *str, uintmax_t *ret) /* * perform the conversion */ - errno = 0; /* pre-clear errno for warnp() */ + errno = 0; /* pre-clear errno */ num = strtoumax(str, &endptr, 10); saved_errno = errno; if (endptr == str) { @@ -248,7 +248,7 @@ string_to_uintmax(char const *str, uintmax_t *ret) return false; } else if (saved_errno != 0) { errno = saved_errno; - warnp(__func__, "error converting string \"%s\" to uintmax_t", str); + warn(__func__, "error converting string \"%s\" to uintmax_t", str); return false; } else if (num <= 0 || num >= UINTMAX_MAX) { warn(__func__, "number %s out of range for uintmax_t (must be >= %d && < %ju)", str, 0, UINTMAX_MAX); diff --git a/version.h b/version.h index b814bfd..5bdf021 100644 --- a/version.h +++ b/version.h @@ -55,7 +55,7 @@ * * NOTE: this should match the latest Release string in CHANGES.md */ -#define JPARSE_REPO_VERSION "2.5.0 2025-10-02" /* format: major.minor YYYY-MM-DD */ +#define JPARSE_REPO_VERSION "2.5.1 2025-10-31" /* format: major.minor YYYY-MM-DD */ /* * official jparse version @@ -70,7 +70,7 @@ /* * official utility functions (util.c) version */ -#define JPARSE_UTILS_VERSION "2.1.5 2025-10-02" /* format: major.minor YYYY-MM-DD */ +#define JPARSE_UTILS_VERSION "2.1.6 2025-10-31" /* format: major.minor YYYY-MM-DD */ #endif /* INCLUDE_JPARSE_VERSION_H */