Jacob, Thank you very much. I did use -Wall compiler option. Nevertheless, declaring the variables in the smallest scope is a very good way to avoid uninitialized usage of the variables.
Jiannan ________________________________ From: Jacob Faibussowitsch <[email protected]> Sent: Friday, June 9, 2023 3:55 PM To: Tu, Jiannan <[email protected]> Cc: Barry Smith <[email protected]>; [email protected] <[email protected]> Subject: Re: [petsc-users] Unconditional jump or move depends on uninitialised value(s) You don't often get email from [email protected]. Learn why this is important<https://aka.ms/LearnAboutSenderIdentification> CAUTION: This email was sent from outside the UMass Lowell network. > 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 <[email protected]> wrote: I'll see what gcc complier options I should use to detect the use of declared variables that are not initialized
