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

Mikhail R. Gadelha via libc-commits libc-commits at lists.llvm.org
Fri Sep 29 15:17:19 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:

we seem to be pulling `wint_t` from `stddef.h`, where it's defined as `unsigned int` (`__WINT_TYPE__`)...

Here's the relevant preprocessed code from `src/wchar/wctob.cpp`, with GCC:
```
# 1 "/usr/lib/gcc/x86_64-linux-gnu/13/include/stddef.h" 1 3 4
# 359 "/usr/lib/gcc/x86_64-linux-gnu/13/include/stddef.h" 3 4
typedef unsigned int wint_t;
```
and clang:
```
# 1 "/usr/lib/llvm-15/lib/clang/15.0.7/include/stddef.h" 1 3
# 116 "/usr/lib/llvm-15/lib/clang/15.0.7/include/stddef.h" 3
typedef unsigned int wint_t;
``` 


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


More information about the libc-commits mailing list