[libc-commits] [libc] [libc][NFC] Couple of small warning fixes (PR #67847)

Mikhail R. Gadelha via libc-commits libc-commits at lists.llvm.org
Mon Oct 2 12:35:44 PDT 2023


================
@@ -28,7 +28,7 @@ namespace internal {
 LIBC_INLINE cpp::optional<int> wctob(wint_t c) {
   // This needs to be translated to EOF at the callsite. This is to avoid
   // including stdio.h in this file.
-  if (c > 127 || c < 0)
----------------
mikhailramalho wrote:

alright, I also tried to do:
```
+  if (cpp::is_signed<wint_t>::value && c < 0)
+    return cpp::nullopt;
```
but gcc still shows the warning :/ I'll add it back and add a comment

https://github.com/llvm/llvm-project/pull/67847


More information about the libc-commits mailing list