<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=utf-8"><meta name=Generator content="Microsoft Word 15 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Menlo;
panose-1:0 0 0 0 0 0 0 0 0 0;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
span.EmailStyle18
{mso-style-type:personal-reply;
font-family:"Calibri",sans-serif;
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-US link=blue vlink=purple style='word-wrap:break-word'><div class=WordSection1><p class=MsoNormal>I ran into a similar problem months ago and the long and short of it is that any compilers uninitialized variable detection is incredibly dependent on optimization level, which the higher you go becomes non-deterministic.<o:p></o:p></p><div><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>That being said, gcc is pretty terrible at getting this particular warning right :) <a href="https://gcc.gnu.org/bugzilla/buglist.cgi?quicksearch=may%20be%20uninitialized">https://gcc.gnu.org/bugzilla/buglist.cgi?quicksearch=may%20be%20uninitialized</a><o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Best regards,<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Jacob Faibussowitsch<o:p></o:p></p><p class=MsoNormal>(Jacob Fai - booss - oh - vitch)<o:p></o:p></p><p class=MsoNormal>Cell: (312) 694-3391<span style='color:black'><o:p></o:p></span></p></div><p class=MsoNormal><o:p> </o:p></p><div style='border:none;border-left:solid blue 1.5pt;padding:0in 0in 0in 4.0pt'><div><div style='border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in'><p class=MsoNormal><b>From:</b> petsc-dev <petsc-dev-bounces@mcs.anl.gov> <b>On Behalf Of </b>Barry Smith<br><b>Sent:</b> Sunday, April 11, 2021 17:51<br><b>To:</b> Mark Adams <mfadams@lbl.gov><br><b>Cc:</b> For users of the development version of PETSc <petsc-dev@mcs.anl.gov><br><b>Subject:</b> Re: [petsc-dev] CI error<o:p></o:p></p></div></div><p class=MsoNormal><o:p> </o:p></p><div><p class=MsoNormal><o:p> </o:p></p></div><p class=MsoNormal> You might be able to do:<o:p></o:p></p><div><p class=MsoNormal><o:p> </o:p></p></div><div><blockquote style='margin-top:5.0pt;margin-bottom:5.0pt'><div><blockquote style='border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-right:0in'><div><div><div><p class=MsoNormal style='background:#111111'><span style='font-size:10.0pt;font-family:"Menlo",serif;color:white'>col_scale[LANDAU_MAX_Q_FACE = {0};<o:p></o:p></span></p></div></div></div></blockquote></div></blockquote><div><p class=MsoNormal><o:p> </o:p></p></div><p class=MsoNormal>but then the compiler may complain about not initializing enough values. Googling this type of initialization might help, something C initialize arrays "<span style='font-size:10.0pt;font-family:"Menlo",serif;color:white;background:#111111'>may be used uninitialized"</span><o:p></o:p></p></div><div><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Menlo",serif;color:white;background:#111111'><br><br></span><o:p></o:p></p></div><div><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Menlo",serif;color:white;background:#111111'><br><br></span><o:p></o:p></p><div><p class=MsoNormal><br><br><o:p></o:p></p><blockquote style='margin-top:5.0pt;margin-bottom:5.0pt'><div><p class=MsoNormal>On Apr 11, 2021, at 2:05 PM, Mark Adams <<a href="mailto:mfadams@lbl.gov">mfadams@lbl.gov</a>> wrote:<o:p></o:p></p></div><p class=MsoNormal><o:p> </o:p></p><div><div><p class=MsoNormal>This warning went away. i don't know why.<o:p></o:p></p></div><p class=MsoNormal><o:p> </o:p></p><div><div><p class=MsoNormal>On Sun, Apr 11, 2021 at 2:10 PM Mark Adams <<a href="mailto:mfadams@lbl.gov">mfadams@lbl.gov</a>> wrote:<o:p></o:p></p></div><blockquote style='border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-right:0in'><div><p class=MsoNormal>I get this error in CI with complex float: <a href="https://gitlab.com/petsc/petsc/-/jobs/1170144554" target="_blank">https://gitlab.com/petsc/petsc/-/jobs/1170144554</a><o:p></o:p></p><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>I put in code earlier to fix this warning about uninitialized vars, but now it does not seem to work:<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><div><p class=MsoNormal style='background:#111111'><span style='font-size:10.0pt;font-family:"Menlo",serif;color:white'>/home/glci/builds-stage1/AbTGp5-t/0/petsc/petsc/src/ts/utils/dmplexlandau/plexland.c:414:94: error: ‘col_scale[4]’ may be used uninitialized in this function [-Werror=maybe-uninitialized]<o:p></o:p></span></p></div><div><p class=MsoNormal style='background:#111111'><span style='font-size:10.0pt;font-family:"Menlo",serif;color:white'><a href="https://gitlab.com/petsc/petsc/-/jobs/1170144554#L2251" target="_blank"><span style='color:#666666'>2251</span></a> PetscScalar vals[LANDAU_MAX_Q_FACE*LANDAU_MAX_Q_FACE],row_scale[LANDAU_MAX_Q_FACE],col_scale[LANDAU_MAX_Q_FACE];<o:p></o:p></span></p></div></div><p class=MsoNormal><br>Yet I have code to initialize col_scale:<o:p></o:p></p><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal> for (q = 0; q < LANDAU_MAX_Q_FACE; q++) col_scale[q] = 0.0; // suppress warnings<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>I get a similar error with an integer array. <o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>Any suggestions?<o:p></o:p></p></div></div></blockquote></div></div></blockquote></div><p class=MsoNormal><o:p> </o:p></p></div></div></div></body></html>