cppcheck icon indicating copy to clipboard operation
cppcheck copied to clipboard

Feature/mismatch type in for assigment

Open Alon-Alexander opened this issue 3 years ago • 3 comments

Solves #5994.

A few notes:

  • I don't know where is the correct place to put this check (I don't think it is where I put it, but moving is easier than implementing).
  • How should this test be disabled (for example when not wanting warnings), I don't know the current method.
  • How should I decide on the error message? Should it be normalized to some standard or taken from somewhere?

Alon-Alexander avatar Jul 10 '22 15:07 Alon-Alexander

Sorry .. I suggested that you would move this to CheckFunction but now I think CheckType would be better.

danmar avatar Jul 19 '22 21:07 danmar

@danmar I struggle with a strange behaviour - When running the compiled binary on the code in the test, it prints the error as expected, but in the test it fails the assert, saying no output was generated. Have you ever encountered that before?

Alon-Alexander avatar Aug 01 '22 20:08 Alon-Alexander

I guess it's because TestType does not load the std.cfg.

But it can also be because the code is not normally preprocessed in the testrunner. You can't use preprocessor commands and you can't use tabs anywhere in the code.

danmar avatar Aug 07 '22 18:08 danmar