在 2025-12-29 01:35, Pali Rohár 写道:
---
  mingw-w64-crt/testcases/Makefile.am |  1 +
  mingw-w64-crt/testcases/t_time32.c  | 26 ++++++++++++++++++++++++++
  2 files changed, 27 insertions(+)
  create mode 100644 mingw-w64-crt/testcases/t_time32.c

diff --git a/mingw-w64-crt/testcases/t_time32.c 
b/mingw-w64-crt/testcases/t_time32.c
new file mode 100644
index 000000000000..980d2755dcc2
--- /dev/null
+++ b/mingw-w64-crt/testcases/t_time32.c
@@ -0,0 +1,26 @@
+#include <stdio.h>
+#include <sys/timeb.h>
+#include <time.h>
+#include <utime.h>
+
+int main() {
+    /* Check that all 32-bit time functions are present and can be called */
+    struct tm tm;
+    __time32_t t;
+    struct __timeb32 tb;
+    struct __utimbuf32 utb;
+    _ctime32(&t);
+    _difftime32(t, t);

This fails to compile; those variables require initialization:


../../testcases/t_time32.c: In function 'main':
../../testcases/t_time32.c:12:5: error: 't' may be used uninitialized 
[-Werror=maybe-uninitialized]
   12 |     _ctime32(&t);
      |     ^~~~~~~~~~~~
In file included from ../../testcases/t_time32.c:3:
D:/a/_temp/msys64/gcc-mingw/i686-w64-mingw32/include/time.h:144:25: note: by argument 1 of type 'const __time32_t *' {aka 'const long int *'} to '_ctime32' declared here
  144 |   _CRTIMP char *__cdecl _ctime32(const __time32_t *_Time) 
__MINGW_ATTRIB_DEPRECATED_SEC_WARN;
      |                         ^~~~~~~~
../../testcases/t_time32.c:9:16: note: 't' declared here
    9 |     __time32_t t;
      |                ^

--
Best regards,
LIU Hao

Attachment: OpenPGP_signature.asc
Description: OpenPGP digital signature

_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to