Piotr Caban (@piotr) commented about dlls/msvcrt/tests/printf.c:
{ "% d", " 1", 0, INT_ARG, 1 }, { "%+ d", "+1", 0, INT_ARG, 1 }, { "%S", "wide", 0, PTR_ARG, 0, 0, 0, L"wide" }, + { "%Z", "ansi", 0, PTR_ARG, 0, 0, 0, &(ANSI_STRING){ 4, 4, (char *)"ansi" } },
This is not portable, please define ANSI_STRING/UNICODE_STRING structures separately and use pointers to them here. Please also add %Z format test in swprintf test (to show that it uses ANSI_STRING). Please also check the function behavior with ucrtbase - current implementation will fail there. Its behavior probably changes based on \_CRT_INTERNAL_PRINTF_LEGACY_WIDE_SPECIFIERS or \_CRT_INTERNAL_PRINTF_LEGACY_MSVCRT_COMPATIBILITY flag. Please also add tests to ucrtbase. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/10460#note_134548