[libcxx-commits] [PATCH] D128600: [libc++][mingw] Remove setlocale from snprintf_l

Martin Storsjö via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Mon Jun 27 03:37:36 PDT 2022


mstorsjo added a comment.

In D128600#3611520 <https://reviews.llvm.org/D128600#3611520>, @alvinhochun wrote:

> In D128600#3611043 <https://reviews.llvm.org/D128600#3611043>, @mstorsjo wrote:
>
>> I guess the more complete/proper way forward would make a mingw-w64 specific implementation of these (or some similar) functions too, if `__USE_MINGW_ANSI_STDIO` is set to 1. (No idea offhand how hard that would be though...)
>
> Hypothetically, if this means implementing custom formatting routines, wouldn't it be better to just use the same implementation for both msvc and mingw-w64?

I didn’t mean implementing formatters from scratch (fwiw, libc++ does have that already for the modern std::format stuff too). Mingw-w64 already has got its own formatters that are used when `__USE_MINGW_ANSI_STDIO` is defined - I meant extending that with an entry point that takes a locale parameter. (Not sure if that’s straightforward or requires touching everything though.)

But on the other hand, now that libc++ does have its own formatters, I guess it could be useful to use that for these older formatting cases too, instead of relying on the libc?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D128600/new/

https://reviews.llvm.org/D128600



More information about the libcxx-commits mailing list