siemens / CtrlppCheck

GNU General Public License v3.0
14 stars 11 forks source link

Unused variables #61

Closed maxChevSOL closed 1 year ago

maxChevSOL commented 1 year ago

Describe the bug

Iterators defined outside of their loop, a fortiriori when they are defined in a bigger scope than the conditional one where they are in used, get falsely interpreted as “unused variables”.

To Reproduce Steps to reproduce the behavior:

  1. Open any library/script where an iterator is declared outside of the loop(s) it is intended for.
  2. Run Ctrlpp Check for that specific library/script.
  3. Click on the error tab.
  4. A "unused variable" error message is to be seen.

Expected behavior The program should be able to interpret the pre-declaration of an iterator as a legitimate operation. Any variable playing the role of an iterator should not be described as an "unused" one.

dhoegerlETM commented 1 year ago

Not reproducible with version 1.0.2. It rather produces style warning "scope can be reduced", which is OK.