Author Topic: scan-build of trunk found e.g. potentially dereferencing null, patch attached  (Read 4074 times)

Offline blauzahn

  • Almost regular
  • **
  • Posts: 129
Occasionally, I do a (clang) scan-build of cb's trunk with its default set of static analyzer checks. The resulting report (as of now svn 12566), lists numerous potential issues. Unfortunately, these have been accumulated over a long time. I looked into 2 of those and provide small patches for them.

OS: arch linux; wxwidgets (3.1.6): trunk; g++ 11.1.0; clang 13.0.0

Btw: Is there any reason to keep NULL instead of nullptr in cb's c++ (not c-) code? Since this is very low hanging fruit, are there any objections to successively replace them in chunks within trunk? I'd skip imported 3rd-party code like wxscintilla since it would make diffs to their source noisier.

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3263
The reason is time...

I think patches are better in the bug tracker...

Offline Miguel Gimenez

  • Developer
  • Lives here!
  • *****
  • Posts: 1209
Worse, not only NULL is used but 0L I change them to nullptr whenever I work near any, but I have not searched for them expilcitly.

EDIT: I have just removed almost all 0L from the main project, plugins will follow...
« Last Edit: December 20, 2021, 03:39:00 pm by Miguel Gimenez »

Offline Miguel Gimenez

  • Developer
  • Lives here!
  • *****
  • Posts: 1209
0L changed to nullptr applied in [r12598]
Blauzahn patches applied in [r12599]

Offline blauzahn

  • Almost regular
  • **
  • Posts: 129
Thank you.