Silence warning -Wconversion in GCC 15.2 and -Wsign-conversion in Clang 21.1.8#3061
Silence warning -Wconversion in GCC 15.2 and -Wsign-conversion in Clang 21.1.8#3061hanickadot wants to merge 2 commits into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## devel #3061 +/- ##
=======================================
Coverage 91.14% 91.15%
=======================================
Files 202 202
Lines 8831 8832 +1
=======================================
+ Hits 8049 8050 +1
Misses 782 782 🚀 New features to boost your workflow:
|
|
|
||
| auto colInfo = tp.m_columnInfos[tp.m_currentColumn]; | ||
| auto colInfo = | ||
| tp.m_columnInfos[static_cast<size_t>( tp.m_currentColumn )]; |
There was a problem hiding this comment.
tp.m_currentColumn should be changed to be unsigned instead. The only place where it uses the fact that it is signed is using -1 as guard value after reset.
rajpratham1
left a comment
There was a problem hiding this comment.
Thanks for addressing the new GCC 15.2/Clang 21.1.8 conversion warnings. The explicit casts around hashing (unsigned char) and the timer code make sense to me. However, a couple of the other changes appear to suppress warnings rather than address the underlying type mismatch. In particular, I agree with the earlier comment that tp.m_currentColumn should probably become an unsigned index (or use a different sentinel representation) instead of adding a static_cast<size_t> at every access. Similarly, the static_cast used for the vector iterator offset seems less appropriate than using the container's difference_type or revisiting the member type. I'd prefer those underlying type issues to be addressed rather than relying on casts.
Description
This small PR add explicit cast from
size_ttointwhen callingstd::setw(...)to silence warning produced by GCC 15.2.This also fixes conversions between sign types in Clang 21.1.8.