[libcxx-commits] [PATCH] D120088: [libcxx] Fix the error checking for wctob_l, fixing locale narrow function on Windows

Martin Storsjö via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Thu Feb 24 02:45:39 PST 2022


mstorsjo marked an inline comment as done.
mstorsjo added inline comments.


================
Comment at: libcxx/src/locale.cpp:1527
     int r = __libcpp_wctob_l(c, __l);
-    return r != static_cast<int>(WEOF) ? static_cast<char>(r) : dfault;
+    return r != static_cast<int>(EOF) ? static_cast<char>(r) : dfault;
 }
----------------
Quuxplusone wrote:
> I don't think the cast to `int` is doing anything anymore; what goes wrong if you remove it? Ditto below.
Sure, it should work just fine to drop the cast.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D120088



More information about the libcxx-commits mailing list