<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/69444>69444</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[clang][Sema] Question: Why is `-Wshorten-64-to-32` disjoint from `-Wimplicit-int-conversion`?
</td>
</tr>
<tr>
<th>Labels</th>
<td>
enhancement,
question,
c++,
clang:frontend
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
whisperity
</td>
</tr>
</table>
<pre>
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 263a48b781f360fc75f4b95fb9abbb866209cb21 where this warning was introduced, and that is **ancient**, but history runs dry at that point.
> CC @dwblaikie, @rjmccall. Your names appeared in the relevant code path.
----
**What would be the cons against enabling `-Wshorten-64-to-32` under `-Wimplicit-int-conversion` implicitly?**
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyEVN2O4zYPfRrlhnBgyz8TX-TCM_Plw6It0GJRDHo10A9ta1aWvBKdbPr0hexMpym6WCCIZZEmeQ7JI2I0g0M8svqR1c87sdDow_EymjhjMHTdSa-vx86BcYQBIxk3gBIR4SIioFN-WQ0aLiMGBOXdGUM03kXog5_AijBgAGkouxhN4xpowBCBPMRJWHtn9Q4jmAiMdwM6DMLaK-MdBJx9INQgr8CaPHsx02yNMpQZR9lHVtbkwPih5Cl80TD-BEWTzof1yA_p3FTpBUntGW9TKsY7_KZwpu0MvQ_QVMm15M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