On Friday 23 December 2022 17:21:38 Pali Rohár wrote: > On Friday 23 December 2022 22:20:25 LIU Hao wrote: > > 在 2022-12-04 21:49, Pali Rohár 写道: > > > Format attributes is interesting issue. Because there are already > > > following > > > printf implementations: > > > > > > 1) C89 (without %lld) (crtdll.dll, msvcrt10.dll) > > > 2) C89 (without %lld) + MS extensions %I64d (msvcrt20.dll - msvcr110.dll) > > > 3) C99 (with %lld) + MS extensions %I64d (msvcr120.dll, vcruntime140.dll) > > > 4) C99 (with %lld) + GNU extensions (this is what glibc has) > > > 5) C99 (with %lld) + MS extensions + GNU extensions (mingw-w64 pformat.c) > > > > > > > This is not 100% correct. The MS printf specification never conforms to the > > C99 standard: > > > > 1) `%hhd` expects a `short` instead of `signed char`, verified with > > MSVCR120 and MSVCRT on Win10. > > 2) `%zd`, `%td`, `%jd` are all unsupported up to MSVCR120, which, > > however, MSVCRT on Win10 seems to support. > > 3) `%Lg` matches `long double` in MS ABI i.e. the same with `double`. > > Thanks for information! It just means that we have more than above 5 > printf versions widely used. > > > I don't think it's practically possible to provide unified non-inline > > *printf functions. > > Why not? How inline and non-inline differs here? The issue is with > format attribute, but because gcc does not provide all 8 versions > mentioned here, it just means that both inline and non-inline versions > have same issues.
Any comment on this last section? The patch is for UCRT variant-only. So above stuff around different msvcrt format strings does not apply here for UCRT-only patch. _______________________________________________ Mingw-w64-public mailing list Mingw-w64-public@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mingw-w64-public