[petsc-users] Unconditional jump or move depends on uninitialised value(s)

Jacob Faibussowitsch jacob.fai at gmail.com
Fri Jun 9 14:55:27 CDT 2023


> I'll see what gcc complier options I should use to detect the use of declared variables that are not initialized


The flag you are looking for is -Wall. Please fix all the warnings that it may raise.

Generally speaking, it is also much easier to ensure your variables are initialized if you restrict them to the smallest scope possible. That is, declare the variable immediately before you use it. If you only use it within a loop,  then only declare it inside that loop. If you only use it in an if branch, then only declare it inside that branch.

Best regards,

Jacob Faibussowitsch
(Jacob Fai - booss - oh - vitch)

> On May 10, 2023, at 12:38, Tu, Jiannan <Jiannan_Tu at uml.edu> wrote:
> 
> I'll see what gcc complier options I should use to detect the use of declared variables that are not initialized
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20230609/26774a01/attachment.html>


More information about the petsc-users mailing list