[newlib-cygwin/main] Fix newlib/testsuite/newlib.time/tzset.c compilation for 16-bit targets
Jeff Johnston
jjohnstn@sourceware.org
Wed Jul 15 00:05:40 GMT 2026
https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=e4837fb53052a8c1d6b06758a0450a385e4cc015
commit e4837fb53052a8c1d6b06758a0450a385e4cc015
Author: Jan Dubiec <jdx@o2.pl>
Date: Mon Jul 13 02:39:54 2026 +0200
Fix newlib/testsuite/newlib.time/tzset.c compilation for 16-bit targets
When the test case is compiled for a target with a 16-bit int, the compiler
emits the two warnings shown below, causing the test to fail. The code
assumes that int is 32 bits wide, which is not always the case. This patch
removes that assumption and fixes the resulting compilation warnings.
Signed-off-by: Jan Dubiec <jdx@o2.pl>
Diff:
---
newlib/testsuite/newlib.time/tzset.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/newlib/testsuite/newlib.time/tzset.c b/newlib/testsuite/newlib.time/tzset.c
index db25077ce..870d42642 100644
--- a/newlib/testsuite/newlib.time/tzset.c
+++ b/newlib/testsuite/newlib.time/tzset.c
@@ -1,18 +1,19 @@
/* Test that valid POSIX timezone strings are correctly parsed by tzset(3). */
#include <stdio.h>
#include <stdlib.h>
+#include <stdint.h>
// BEGIN test vectors
#include <time.h>
#include <limits.h>
-#define IN_SECONDS(h, m, s) ((h) * 3600 + (m) * 60 + (s))
+#define IN_SECONDS(h, m, s) ((h) * INT32_C(3600) + (m) * INT32_C(60) + (s))
#define NO_TIME INT_MIN
struct tz_test {
const char* tzstr;
- int offset_seconds;
- int dst_offset_seconds;
+ int32_t offset_seconds;
+ int32_t dst_offset_seconds;
};
extern struct tm winter_tm;
More information about the Newlib-cvs
mailing list