ternaus / quest-qmc

Automatically exported from code.google.com/p/quest-qmc
Other
2 stars 11 forks source link

Errors and Warnings reported by the Intel analysis tool. #19

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
There are several Intel compiler flags that will do static analysis of the code 
which will help to avoid/fix bugs.

“-diag-enable sc1” reports only diagnostics with a 
severity level of "critical"

“-diag-enable sc2” reports all diagnostics with a severity level of 
"critical" and "error"

“-diag-enable sc3” This will cause static analysis to report all 
diagnostics regardless of the severity level

I checked QUEST code. This is report for ggeom.F90 with “-diag-enable sc3”

I did not figure out how to make this report to look really nice in linux, so 
just raw pdf attached.
99 errors/warnings. It will be nice if we reduce this number.

From the Intel website:
"
In the case of legacy projects, ask the developers to submit new code only if 
they reduce the number of findings.
In the case of coding from scratch, allow no findings before uploading new code 
in your repository.
"

Original issue reported on code.google.com by iglovi...@gmail.com on 29 Dec 2013 at 2:37

Attachments:

GoogleCodeExporter commented 9 years ago
I looked into quite a few of these. They all seem to be irrelevant and, in some 
case, plain wrong. Like
a variable claimed to be uninitialized when it was read from input a few lines 
earlier. Or a pointer
allocated in a subroutine A, used in a subroutine B contained in A, and claimed 
to be used before
being allocated.

Original comment by simone.c...@gmail.com on 2 Jan 2014 at 1:53

GoogleCodeExporter commented 9 years ago
Revision d0226051e1a1 reduced number of warnings/errors to 97.

Original comment by iglovi...@gmail.com on 2 Jan 2014 at 2:13

GoogleCodeExporter commented 9 years ago

Original comment by iglovi...@gmail.com on 2 Jan 2014 at 2:17

Attachments:

GoogleCodeExporter commented 9 years ago
I agree. These warnings are not a big deal. Although I do not like warnings.

Usually:
[1] Some of these can be a hint of some bigger problem. 
[2] Wrong or irrelevant warnings tell me that structure of the code is not as 
good as it should be. (Parameters of the functions should be sent in some other 
way, structures should be defined a bit different, etc)

It is usually something that people discuss at:
http://fortran90.org/src/best-practices.html
http://www.cs.rpi.edu/~szymansk/OOF90/bugs.html

For example in the last link they discuss approaches that can lead to some 
potential bugs with examples, and I think I've seen similar things in the QUEST 
source code. May be this Intel Static Analysis Tool, tries to point this out.

Anyway, this warning are not really that important, although I would be upset 
if their number will start growing.

Original comment by iglovi...@gmail.com on 2 Jan 2014 at 2:30

GoogleCodeExporter commented 9 years ago
Revison cc56e18890a1 reduced number of warnings/errors to 95.

Original comment by iglovi...@gmail.com on 7 Feb 2014 at 11:41