sherpa is hosted by Hepforge, IPPP Durham
close Warning: Can't synchronize with repository "(default)" (/hepforge/svn/sherpa does not appear to be a Subversion repository.). Look in the Trac log for more information.

Opened 9 years ago

Last modified 8 years ago

#363 new task

Fix "bugs" found by static code analysis — at Version 1

Reported by: Enrico Bothmann Owned by: Frank Siegert
Priority: minor Milestone: perfect
Component: Hadron Decays Version: 0.trunk
Keywords: Cc:

Description (last modified by Frank Siegert)

Static analysis finds dead code and potential bugs by walking through every possible code path. As some code paths are never used during the run, these bugs mostly are false-positives.†

Still I think it's worthwhile and a concrete measure to improve the code quality/legibility and sometimes even performance/memory efficiency to use these analysis reports.

I dumped one for trunk/r27061:

http://physik2.uni-goettingen.de/~ebothmann/sherpa/scan-build-2016-01-09/

My suggestion is that each of us looks through and fixes the bugs at least in the module she/he is responsible for, following the discussion at the meeting in Dresden.

  • CSShower++/MCatNLO (see r27093), PDF: eno
  • AMEGIC++: Steffen
  • HADRONS++: FrankS
  • PHASIC++/Decays: FrankS
  • ...

Maybe you can quickly drop a comment here if you (intent to) clean a module in this way, to prevent work duplication.

† static analysis heeds "assert" statements. E.g. a "dereference of null pointer" bug can be "fixed" by a line like "assert(ptr != NULL)", which also more explicitly states the intent of the developer and leads to more expressive crashes if not met.

Change History (1)

comment:1 Changed 9 years ago by Frank Siegert

Description: modified (diff)

Hi Enrico,

thanks for the code analysis results. I'll take care of HADRONS++ and PHASIC++/Decays.

Cheers, Frank

Note: See TracTickets for help on using tickets.