[libc-commits] [libc] [libc] Enable -Wconversion (PR #127523)

Vinay Deshmukh via libc-commits libc-commits at lists.llvm.org
Tue Feb 25 18:16:13 PST 2025


vinay-deshmukh wrote:

@nickdesaulniers 

I'm seeing :

```
[ RUN      ] LlvmLibcIntegerToStringTest.UINT256_Base_16
/Users/runner/work/llvm-project/llvm-project/libc/test/src/__support/integer_to_string_test.cpp:241: FAILURE
      Expected: buffer.view()
      Which is: 0000000000000000000000000000000000000000000000000000000000010000
To be equal to: string_view("0000000000000000000000000000000000000000000000000000000000012345")
      Which is: 0000000000000000000000000000000000000000000000000000000000012345
/Users/runner/work/llvm-project/llvm-project/libc/test/src/__support/integer_to_string_test.cpp:245: FAILURE
      Expected: buffer.view()
      Which is: 0000000000000000000000000000000010000000000000000000000000000000
To be equal to: string_view("0000000000000000000000000000000012340000000000000000000000000000")
      Which is: 0000000000000000000000000000000012340000000000000000000000000000
/Users/runner/work/llvm-project/llvm-project/libc/test/src/__support/integer_to_string_test.cpp:249: FAILURE
      Expected: buffer.view()
      Which is: 0000000000000000000000000000000100000000000000000000000000000000
To be equal to: string_view("0000000000000000000000000000000123400000000000000000000000000000")
      Which is: 0000000000000000000000000000000123400000000000000000000000000000
/Users/runner/work/llvm-project/llvm-project/libc/test/src/__support/integer_to_string_test.cpp:253: FAILURE
      Expected: buffer.view()
      Which is: 1000000000000000000000000000000000000000000000000000000000000000
To be equal to: string_view("1234000000000000000000000000000000000000000000000000000000000000")
      Which is: 1234000000000000000000000000000000000000000000000000000000000000
```

also fail locally for me, but I'm not able to figure out what's going wrong.

My guess is for u256, the buffer size being calculated as 40 could be wrong here:
https://github.com/llvm/llvm-project/blob/da37c76ac621c64216e56ead3efe1bd569250ee2/libc/src/__support/integer_to_string.h#L373

if at all.

AFAIK I haven't changed code near/around this component, so not sure why it's begun to fail for:

https://github.com/llvm/llvm-project/actions/runs/13486324597/job/37677924941?pr=127523

overlay tests debug


P.S.

overlay tests have been fixed for the most part, for the "full build" tests I can try fixing && pushing and let the CI tell me about errors.

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


More information about the libc-commits mailing list