On Mon Feb 5 19:12:25 2024 +0000, Piotr Caban wrote:
The function succeeds for `*secs == -1` in ucrtbase (I didn't test other versions).
I am reproducing this result with ucrtbase only when adding ported test_gmtime() to ucrtbase/tests/misc.c in the end, with invalid parameter handler set in the previous tests. The attached test (on top of the present patchset) succeeds for me on Windows 10. This test has _set_invalid_parameter_handler(NULL); before the added tests. So unless I am missing something this specific behaviour with *secs < 0 succeeding is related to the presence of invalid parameter handler and not to actual acceptance of *secs < 0 result. We are currently missing such handling in ucrtbase time functions but that looks unrelated?
[test.patch](/uploads/fb6429ea32d7760cab1ee9d82bc22129/test.patch)