在 2025-12-20 05:42, Luca Bacci 写道:
Hello!

I think you can just do `_crt_atexit((_PVFV)(intptr_t) _flushall)` without 
introducing a new function

Yeah, consider however that _flushall flushes both output and input streams. 
Flushing input streams seems to be a no-op on the UCRT, but probably discards 
data on earlier CRT libraries.

Oh it makes sense. Please send a new patch with these changes:

1. The call to `atexit()` should not be outside `__native_startup_lock`. Maybe
   you can add it around the call to `setvbuf()` in your other patch.

2. `__mingw_safeStdioFlush()` isn't visible externally, so it need not be named
   with a `__mingw_` prefix.

3. Is it really necessary to check the result of `atexit()`? I think such errors
   may be ignored. (Also, even when you do want to handle errors, it's incorrect
   to return from the entry-point function; call `abort()` instead.)


--
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