<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
"http://www.w3.org/TR/REC-html40/loose.dtd">
<!-- 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;">
Dear Zhou, Houi, Thank you very much for your detailed analysis! It is indeed a bit strange. I obtained that result using the beta version 16. 0. 0 20251216 (experimental) of gcc/gfortran. In any case with the last configuration, that I transcribed</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="pfptBannerceu37kx" 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="pfptBannerceu37kx" style="all: unset !important; float:left !important; display:block !important; margin: 0px 0px 1px 0px !important; max-width: 600px !important;">
<div id="pfptBannerceu37kx" 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="pfptBannerceu37kx" 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>
#pfptBannerceu37kx { all: revert !important; display: block !important;
visibility: visible !important; opacity: 1 !important;
background-color: #D0D8DC !important;
max-width: none !important; max-height: none !important }
.pfptPrimaryButtonceu37kx:hover, .pfptPrimaryButtonceu37kx:focus {
background-color: #b4c1c7 !important; }
.pfptPrimaryButtonceu37kx:active {
background-color: #90a4ae !important; }
</style>
<!-- BaNnErBlUrFlE-HeAdEr-end -->
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title></title>
</head>
<body style="font-family:Arial;font-size:14px">
<p>Dear Zhou, Houi,<br>
<br>
Thank you very much for your detailed analysis! It is indeed a bit strange. <br>
I obtained that result using the beta version 16.0.0 20251216 (experimental)<br>
of gcc/gfortran. In any case with the last configuration, that I transcribed in<br>
my previous email, these warnings disappeared.<br>
<br>
Thanks again and regards.<br>
Jorge D'Elia.<br>
<br>
"Zhou, Hui" <<a href="mailto:zhouh@anl.gov">zhouh@anl.gov</a>> escribió:</p>
<blockquote style="border-left:2px solid blue;margin-left:2px;padding-left:12px;" type="cite">
<div class="elementToProof" 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 class="elementToProof" 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 class="elementToProof" 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 class="elementToProof" style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">Hui</div>
<div id="appendonsend">
<hr style="display:inline-block;width:98%" tabindex="-1">
<div dir="ltr" id="divRplyFwdMsg"><font color="#000000" face="Calibri, sans-serif" 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; visibility:hidden; font-size:1px; color:#ffffff; line-height:1px; height:0px; max-height:0px; opacity:0; 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; visibility:hidden; font-size:1px; color:#ffffff; line-height:1px; max-height:0px; opacity:0; overflow:hidden">ZjQcmQRYFpfptBannerStart</div>
<div dir="ltr" id="x_pfptBannerx64dbz2" 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 id="x_pfptBannerx64dbz2" style="float:left!important; display:block!important; margin:0px 0px 1px 0px!important; max-width:600px!important">
<div id="x_pfptBannerx64dbz2" style="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="x_pfptBannerx64dbz2" style="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>
<div style="display:none!important; display:none; visibility:hidden; font-size:1px; color:#ffffff; line-height:1px; max-height:0px; opacity:0; 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>
</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>
</p>
</div>
</div>
</blockquote>
<p><br>
<br>
</p>
</body>
</html>