在 2025-3-22 06:03, Jacek Caban 写道:
On 21.03.2025 18:39, LIU Hao wrote:While this change might be safe, we have code that calls `memset()` to clear small structures such as `mbstate_t` (stdio/mingw_pformat.c) or `struct tm` (secapi/_gmtime32_s.c). If we mean to disable all builts, these operations will become real function calls, which is probably not very good.As part of this change we probably want to turn those references to `__builtin_` ones.That's a good point, I will look at it.
It was too late last night, so I had to go to bed.A little followup: In general we probably don't want to call `memset()` on `mbstate_t`. It can be done with a compound literal:
```
memset(&state, 0, sizeof(state));
state = (mbstate_t) {0}; // C99
state = mbstate_t(); // C++
state = {}; // C++11
```
--
Best regards,
LIU Hao
OpenPGP_signature.asc
Description: OpenPGP digital signature
_______________________________________________ Mingw-w64-public mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/mingw-w64-public
