在 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`.


I don't think it's practically possible to provide unified non-inline *printf 
functions.



--
Best regards,
LIU Hao

Attachment: OpenPGP_signature
Description: OpenPGP digital signature

_______________________________________________
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to