Skip to content

[libc] -Wshift-count-overflow in libc/src/__support/UInt.h #74623

Closed
@nickdesaulniers

Description

@nickdesaulniers
[692/693] Building CXX object projects/libc/src/stdio/prin...s/libc.src.stdio.printf_core.converter.dir/converter.cpp.o
In file included from /android0/llvm-project/libc/src/__support/UInt128.h:12,
                 from /android0/llvm-project/libc/src/__support/FPUtil/FloatProperties.h:12,
                 from /android0/llvm-project/libc/src/__support/FPUtil/FPBits.h:17,
                 from /android0/llvm-project/libc/src/stdio/printf_core/core_structs.h:13,
                 from /android0/llvm-project/libc/src/stdio/printf_core/converter.h:12,
                 from /android0/llvm-project/libc/src/stdio/printf_core/converter.cpp:9:
/android0/llvm-project/libc/src/__support/UInt.h: In instantiation of ‘constexpr __llvm_libc_18_0_0_git::cpp::BigInt<Bits, Signed>::operator T() const [with T = unsigned int; <template-parameter-2-2> = void; long unsigned int Bits = 320; bool Signed = false]’:
/android0/llvm-project/libc/src/__support/float_to_string.h:381:57:   required from here
/android0/llvm-project/libc/src/__support/UInt.h:125:53: warning: left shift count >= width of type [-Wshift-count-overflow]
  125 |       return static_cast<T>((static_cast<T>(val[1]) << 64) + lo);
      |                             ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~

I'm trying to get -Werror re-enabled in #74506; building with GCC flags the above warning.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions