<!-- BaNnErBlUrFlE-BoDy-start -->
<!-- Preheader Text : BEGIN -->
<div style="display:none !important;display:none;visibility:hidden;mso-hide:all;font-size:1px;color:#ffffff;line-height:1px;height:0px;max-height:0px;opacity:0;overflow:hidden;">
Hi Hui, I think the proper way to fix the issue is to use size_t for length variables in the first place ;) Regarding your typecasting concern: If I remember correctly, it is implementation-specific behavior, whether widening or unsigned conversion</div>
<!-- Preheader Text : END -->
<!-- Email Banner : BEGIN -->
<div style="display:none !important;display:none;visibility:hidden;mso-hide:all;font-size:1px;color:#ffffff;line-height:1px;max-height:0px;opacity:0;overflow:hidden;">ZjQcmQRYFpfptBannerStart</div>
<!--[if ((ie)|(mso))]>
<table border="0" cellspacing="0" cellpadding="0" width="100%" style="padding: 16px 0px 16px 0px; direction: ltr" ><tr><td>
<table border="0" cellspacing="0" cellpadding="0" style="padding: 0px 10px 5px 6px; width: 100%; border-radius:4px; border-top:4px solid #90a4ae;background-color:#D0D8DC;"><tr><td valign="top">
<table align="left" border="0" cellspacing="0" cellpadding="0" style="padding: 4px 8px 4px 8px">
<tr><td style="color:#000000; font-family: 'Arial', sans-serif; font-weight:bold; font-size:14px; direction: ltr">
This Message Is From an External Sender
</td></tr>
<tr><td style="color:#000000; font-weight:normal; font-family: 'Arial', sans-serif; font-size:12px; direction: ltr">
This message came from outside your organization.
</td></tr>
</table>
</td></tr></table>
</td></tr></table>
<![endif]-->
<![if !((ie)|(mso))]>
<div dir="ltr" id="pfptBannerxqx0nnk" style="all: revert !important; display:block !important; text-align: left !important; margin:16px 0px 16px 0px !important; padding:8px 16px 8px 16px !important; border-radius: 4px !important; min-width: 200px !important; background-color: #D0D8DC !important; background-color: #D0D8DC; border-top: 4px solid #90a4ae !important; border-top: 4px solid #90a4ae;">
<div id="pfptBannerxqx0nnk" style="all: unset !important; float:left !important; display:block !important; margin: 0px 0px 1px 0px !important; max-width: 600px !important;">
<div id="pfptBannerxqx0nnk" style="all: unset !important; display:block !important; visibility: visible !important; background-color: #D0D8DC !important; color:#000000 !important; color:#000000; font-family: 'Arial', sans-serif !important; font-family: 'Arial', sans-serif; font-weight:bold !important; font-weight:bold; font-size:14px !important; line-height:18px !important; line-height:18px">
This Message Is From an External Sender
</div>
<div id="pfptBannerxqx0nnk" style="all: unset !important; display:block !important; visibility: visible !important; background-color: #D0D8DC !important; color:#000000 !important; color:#000000; font-weight:normal; font-family: 'Arial', sans-serif !important; font-family: 'Arial', sans-serif; font-size:12px !important; line-height:18px !important; line-height:18px; margin-top:2px !important;">
This message came from outside your organization.
</div>
</div>
<div style="clear: both !important; display: block !important; visibility: hidden !important; line-height: 0 !important; font-size: 0.01px !important; height: 0px"> </div>
</div>
<![endif]>
<div style="display:none !important;display:none;visibility:hidden;mso-hide:all;font-size:1px;color:#ffffff;line-height:1px;max-height:0px;opacity:0;overflow:hidden;">ZjQcmQRYFpfptBannerEnd</div>
<!-- Email Banner : END -->
<!-- BaNnErBlUrFlE-BoDy-end -->
<html>
<head><!-- BaNnErBlUrFlE-HeAdEr-start -->
<style>
#pfptBannerxqx0nnk { all: revert !important; display: block !important;
visibility: visible !important; opacity: 1 !important;
background-color: #D0D8DC !important;
max-width: none !important; max-height: none !important }
.pfptPrimaryButtonxqx0nnk:hover, .pfptPrimaryButtonxqx0nnk:focus {
background-color: #b4c1c7 !important; }
.pfptPrimaryButtonxqx0nnk:active {
background-color: #90a4ae !important; }
</style>
<!-- BaNnErBlUrFlE-HeAdEr-end -->
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<div dir="auto">
<div>Hi Hui,</div>
<div dir="auto"><br>
</div>
<div dir="auto">I think the proper way to fix the issue is to use size_t for length variables in the first place ;)</div>
<div dir="auto"><br>
</div>
<div dir="auto">Regarding your typecasting concern: If I remember correctly, it is implementation-specific behavior, whether widening or unsigned conversion happens first (resulting in 0 or 1 in all additional bits, if the value was negative). Depending on
the compiler, your typecast might be the thing that actually happens. If your goal is to always pass an insanely large value for negative values, you should force the widening to happen on signed: (size_t)(long long)upid_len<br>
<div class="gmail_extra" dir="auto"><br>
</div>
<div class="gmail_extra" dir="auto">-Joachim</div>
<div class="gmail_extra" dir="auto"><br>
<div class="gmail_quote">Am 05.02.2026 18:06 schrieb "Zhou, Hui via discuss" <discuss@mpich.org>:<br type="attribution">
<blockquote class="quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr">
<div style="font-family:'aptos' , 'aptos_embeddedfont' , 'aptos_msfontservice' , 'calibri' , 'helvetica' , sans-serif;font-size:12pt;color:rgb( 0 , 0 , 0 )">
It can be ignored.<br>
<br>
I am curious how the compiler arrive at that warning. 18446744071562067968 and 18446744073709551615 in hex are<br>
0xFFFFFFFF80000000 and 0xFFFFFFFFFFFFFFFF, if we cast to unsigned int, they are 2147483648 - 4294967295, and<br>
if we cast to signed int, they are -2147483648 - -1. So The compiler looked at the type of
<code>upid_len</code>, which is an <code>int, and</code><br>
<code>decided it could have negative values, which will become in the range of </code>
0xFFFFFFFF80000000 and<br>
0xFFFFFFFFFFFFFFFF and that exceeds maximum object size.<br>
<br>
So they are complaining an implicit cast from <code>int</code> to size_t in <code>
memcpy. And they want us to add an explicit</code><br>
`(unsigned) upid_len` cast, which does nothing in improving the code safety. In fact, it makes the code worse. Before, if we<br>
accidentally had negative values in <code>int, </code><code style="font-family:'aptos' , 'aptos_embeddedfont' , 'aptos_msfontservice' , 'calibri' , 'helvetica' , sans-serif">which is quite common in errors, the negative value will trigger
</code>an immediate error</div>
<div style="font-family:'aptos' , 'aptos_embeddedfont' , 'aptos_msfontservice' , 'calibri' , 'helvetica' , sans-serif;font-size:12pt;color:rgb( 0 , 0 , 0 )">
in memcpy. With the cast to <code>(unsigned)</code>, the negative values suddenly become good value for memcpy and it will happily</div>
<div style="font-family:'aptos' , 'aptos_embeddedfont' , 'aptos_msfontservice' , 'calibri' , 'helvetica' , sans-serif;font-size:12pt;color:rgb( 0 , 0 , 0 )">
corrupt the memory! It is a warning designed to be silenced and force people to write bad code.<br>
<br>
How stupid is that?<br>
<br>
-- </div>
<div style="font-family:'aptos' , 'aptos_embeddedfont' , 'aptos_msfontservice' , 'calibri' , 'helvetica' , sans-serif;font-size:12pt;color:rgb( 0 , 0 , 0 )">
Hui</div>
<div></div>
<hr style="display:inline-block;width:98%">
<div dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>From:</b> jdelia--- via discuss <discuss@mpich.org><br>
<b>Sent:</b> Wednesday, February 4, 2026 5:37 PM<br>
<b>To:</b> MPICH DISCUSS@MPICH.ORG <discuss@mpich.org><br>
<b>Cc:</b> jdelia@intec.unl.edu.ar <jdelia@intec.unl.edu.ar><br>
<b>Subject:</b> [mpich-discuss] MPICH 5.0.0 released: a warning</font>
<div> </div>
</div>
<div>
<div style="display:none !important;display:none;font-size:1px;color:#ffffff;line-height:1px;height:0px;max-height:0px;overflow:hidden">
Hi there, Today I downloaded the [mpich-announce] MPICH 5. 0. 0 released on a x86_64-pc-linux-gnu Linux machine with Fedora 43. Although the building is fine, the following warning appears during compilation: .. /src/mpid/ch4/src/ch4_proc. c: In</div>
<div style="display:none !important;display:none;font-size:1px;color:#ffffff;line-height:1px;max-height:0px;overflow:hidden">
ZjQcmQRYFpfptBannerStart</div>
<div dir="ltr" style="display:block !important;text-align:left !important;margin:16px 0px 16px 0px !important;padding:8px 16px 8px 16px !important;border-radius:4px !important;min-width:200px !important;background-color:#d0d8dc !important;background-color:#d0d8dc;border-top:4px solid #90a4ae !important;border-top:4px solid #90a4ae">
<div style="float:left !important;display:block !important;margin:0px 0px 1px 0px !important;max-width:600px !important">
<div style="display:block !important;visibility:!important;background-color:#d0d8dc !important;color:#000000 !important;color:#000000;font-family:'arial' , sans-serif !important;font-family:'arial' , sans-serif;font-weight:bold !important;font-weight:bold;font-size:14px !important;line-height:18px !important;line-height:18px">
This Message Is From an External Sender </div>
<div style="display:block !important;visibility:!important;background-color:#d0d8dc !important;color:#000000 !important;color:#000000;font-weight:normal;font-family:'arial' , sans-serif !important;font-family:'arial' , sans-serif;font-size:12px !important;line-height:18px !important;line-height:18px;margin-top:2px !important">
This message came from outside your organization. </div>
</div>
<div style="clear:!important;display:block !important;visibility:!important;line-height:0 !important;font-size:0.01px !important;height:0px">
</div>
</div>
<div style="display:none !important;display:none;font-size:1px;color:#ffffff;line-height:1px;max-height:0px;overflow:hidden">
ZjQcmQRYFpfptBannerEnd</div>
<p>Hi there,<br>
<br>
Today I downloaded the [mpich-announce] MPICH 5.0.0 released<br>
on a x86_64-pc-linux-gnu Linux machine with Fedora 43. <br>
<br>
Although the building is fine, the following warning appears during compilation:<br>
<br>
</p>
<div>../src/mpid/ch4/src/ch4_proc.c: In function ‘MPIDIU_upidhash_add’:</div>
<div>../src/mpid/ch4/src/ch4_proc.c:336:5: warning: ‘memcpy’ specified bound between 18446744071562067968 and 18446744073709551615 exceeds maximum object size 9223372036854775807 [-Wstringop-overflow=]</div>
<div> 336 | memcpy(t->upid, upid, upid_len);</div>
<div> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~</div>
<div><br>
I'd like to know if it can be ignored, or if it would be better to fix it (and<br>
how to do so). Thanks,<br>
<br>
Regards.</div>
<p>Jorge D'Elia.<br>
<br>
</p>
</div>
</div>
</blockquote>
</div>
<br>
</div>
</div>
</div>
</body>
</html>