[clang][Sema] Question: Why is -Wshorten-64-to-32
disjoint from -Wimplicit-int-conversion
?
#69444
Labels
c++
clang:frontend
Language frontend issues, e.g. anything involving "Sema"
enhancement
Improving things as opposed to bug fixing, e.g. new or missing feature
An interesting case was encountered where conversions from larger bit-width integers to smaller bit-width ones is generally reported by
-Wimplicit-int-conversion
(32 to 16, 16 to 8, 128 to 64, etc.) except for 64 to 32, which was given its own warning:-Wshorten-64-to-32
.See http://godbolt.org/z/6q4GMPsxs. Lines 19 (
uint64_t
->uint32_t
) and 35 (int64_t
->int32_t
) are not warned about, unless "Compiler 2"'s warning is enabled.Although
-Weverything
enables both of them at the same time (and neither is enabled by default, AFAIK), it is strange that 64->32 is such a specific dedicated case.Unfortunately, all I could track down was commit 263a48b where this warning was introduced, and that is ancient, but history runs dry at that point.
What would be the cons against enabling
-Wshorten-64-to-32
under-Wimplicit-int-conversion
implicitly?The text was updated successfully, but these errors were encountered: