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

Arthur O'Dwyer via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Wed Feb 23 14:31:49 PST 2022


Quuxplusone accepted this revision as: Quuxplusone.
Quuxplusone added a comment.

Looks like an improvement to me — but I'd like to see my comment explored a bit.



================
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;
 }
----------------
I don't think the cast to `int` is doing anything anymore; what goes wrong if you remove it? Ditto below.


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