I compile a section of code with the following options:
mpif90 -g -C -v -byteswapio -c -Mbounds -Mchkptr -Mchkstk -Mextend -Mfree -Ktrap=fp -i4 -r8 -mcmodel=medium mycode.f
The code runs fine, but I’ve just noticed that within the code there is a variable that is defined but not set. When it is later used it is taking a value of zero.
Variable_C = Variable_A + Variable_B
So Variable_A is set to 10 and then used but Variable_B is used (read from) but not set (written to).
I would like to know if there is a compiler option available that would catch such a mistake.
The real code is rather longer so it’s not always so easy to spot these mistakes!
Thanks in advance for your help,