2

I wish to retrigger a Windows timer using a VCL6 TTimer object. I'm doing this by toggling the Enabled property, this of course can be confusing, but I added a comment about this. For Cppcheck I added a comment as well in its language:

m_pTimer->Enabled = false;
// die "doppelte Zuweisung" sorgt für einen Neustart des Timers
// cppcheck-suppress redundantAssignment
m_pTimer->Enabled = true;

...but it obviously doesn't help, I still see this style warning:

Variable 'Enabled' is reassigned a value before the old one has been used.

What am I doing wrong?

orbitcowboy
  • 1,438
  • 13
  • 25
Wolf
  • 9,679
  • 7
  • 62
  • 108

1 Answers1

1

For the command line version inline suppressions must be enabled through the command line switch --inline-suppr. For details refer to the manual.

For the GUI version you have to activate inline suppressions through the preferences dialog (Menu Edit->Preferences, tab General, Enable inline suppressions).

Jan Schatz
  • 334
  • 2
  • 12
  • 1
    Good point, but I'm using the GUI version. That I should have added to the question. If I would use the command line version, I'd have created a batch for this ensuring to keep the switch set. The GUI version has to be reconfigured after each update, that was the actual problem: I forgot enable inline suppressions again after a Cppcheck update. – Wolf Nov 08 '16 at 09:25
  • 1
    I've got a notion that the GUI is not so well supported. I always had trouble realising my configurations through the GUI and finally switched to the command line. Although I miss to be able to just click on a warning and directly jump into the editor. – Jan Schatz Nov 08 '16 at 10:30
  • 1
    The warning->editor switching is implemented meanwhile, I use it on a regularly base. BTW: If you'd expand your answer to cover the GUI as well (and maybe also some ref link), I'd accept it. – Wolf Nov 08 '16 at 11:04