lamoda - 2024-05-30

cppcheck 2.14.1
https://github.com/danmar/cppcheck/blob/448b95164af1bfe9f9027ceb9a2565f74b9cb835/lib/checkother.cpp#L1159

in cppcheck-gui incorrect show new line \N into \012

CWE: 398
The scope of the variable 'audiocodecid' can be reduced. Warning: Be careful when fixing this message, especially when there are inner loops. Here is an example where cppcheck will write that the scope for 'i' can be reduced:\012void f(int x)\012{\012 int i = 0;\012 if (x) {\012 // it's safe to move 'int i = 0;' here\012 for (int n = 0; n < 10; ++n) {\012 // it is possible but not safe to move 'int i = 0;' here\012 do_something(&i);\012 }\012 }\012}\012When you see this message it is always safe to reduce the variable scope 1 level.

 

Last edit: lamoda 2024-05-31