Running "cppcheck compiz/ --enable=all --report-progress --std=c++11 -v --platform=unix64 2>cppcheck-error.txt --force" (with style and performance checks enabled also) reveals these problems: [compiz/cmake/src/compiz/compiz_discover_gtest_tests.cpp:46]: (performance) Prefix ++/-- operators should be preferred for non-primitive types. Pre-increment/decrement can be more efficient than post-increment/decrement. Post-increment/decrement usually involves keeping a copy of the previous value around and adds a little extra code. [compiz/cmake/src/compiz/compiz_discover_gtest_tests.cpp:49]: (performance) Prefix ++/-- operators should be preferred for non-primitive types. Pre-increment/decrement can be more efficient than post-increment/decrement. Post-increment/decrement usually involves keeping a copy of the previous value around and adds a little extra code. [compiz/compizconfig/gconf/src/gconf.c:479]: (warning) scanf without field width limits can crash with huge input data. To fix this error message add a field width specifier: %s => %20s %i => %3i Sample program that can crash: #include int main() { int a; scanf("%i", &a); return 0; } To make it crash: perl -e 'print "5"x2100000' | ./a.out [compiz/compizconfig/gconf/src/gconf.c:1930]: (error) Memory pointed to by 'pathName' is freed twice. [compiz/compizconfig/gsettings/gsettings_backend_shared/gsettings_util.c:184]: (warning) scanf without field width limits can crash with huge input data. To fix this error message add a field width specifier: %s => %20s %i => %3i Sample program that can crash: #include int main() { int a; scanf("%i", &a); return 0; } To make it crash: perl -e 'print "5"x2100000' | ./a.out [compiz/compizconfig/gsettings/src/gsettings.c:296]: (warning) Casting between double* and float* which have an incompatible binary data representation [compiz/compizconfig/libcompizconfig/backend/src/ini.c:686]: (error) Memory pointed to by 'filePath' is freed twice. [compiz/compizconfig/libcompizconfig/backend/src/ini.c:187]: (error) Common realloc mistake: 'privData' nulled but not freed upon failure [compiz/compizconfig/libcompizconfig/backend/src/ini.c:221]: (error) Common realloc mistake: 'privData' nulled but not freed upon failure [compiz/compizconfig/libcompizconfig/src/bindings.c:216]: (style) The scope of the variable 'buttonStr' can be reduced. Warning: It can be unsafe to fix this message. Be careful. Especially when there are inner loops. Here is an example where cppcheck will write that the scope for 'i' can be reduced: void f(int x) { int i = 0; if (x) { // it's safe to move 'int i = 0' here for (int n = 0; n < 10; ++n) { // it is possible but not safe to move 'int i = 0' here do_something(&i); } } } When you see this message it is always safe to reduce the variable scope 1 level. [compiz/compizconfig/libcompizconfig/src/bindings.c:380]: (warning) scanf without field width limits can crash with huge input data. To fix this error message add a field width specifier: %s => %20s %i => %3i Sample program that can crash: #include int main() { int a; scanf("%i", &a); return 0; } To make it crash: perl -e 'print "5"x2100000' | ./a.out [compiz/compizconfig/libcompizconfig/src/compiz.cpp:3037]: (warning) sscanf %s in format string (no. 1) does not specify a width, use %1023s to prevent overflowing destination: name[1024] [compiz/compizconfig/libcompizconfig/src/compiz.cpp:1554]: (style) The scope of the variable 'j' can be reduced. Warning: It can be unsafe to fix this message. Be careful. Especially when there are inner loops. Here is an example where cppcheck will write that the scope for 'i' can be reduced: void f(int x) { int i = 0; if (x) { // it's safe to move 'int i = 0' here for (int n = 0; n < 10; ++n) { // it is possible but not safe to move 'int i = 0' here do_something(&i); } } } When you see this message it is always safe to reduce the variable scope 1 level. [compiz/compizconfig/libcompizconfig/src/compiz.cpp:1619]: (style) The scope of the variable 'name' can be reduced. Warning: It can be unsafe to fix this message. Be careful. Especially when there are inner loops. Here is an example where cppcheck will write that the scope for 'i' can be reduced: void f(int x) { int i = 0; if (x) { // it's safe to move 'int i = 0' here for (int n = 0; n < 10; ++n) { // it is possible but not safe to move 'int i = 0' here do_something(&i); } } } When you see this message it is always safe to reduce the variable scope 1 level. [compiz/compizconfig/libcompizconfig/src/compiz.cpp:1621]: (style) The scope of the variable 'j' can be reduced. Warning: It can be unsafe to fix this message. Be careful. Especially when there are inner loops. Here is an example where cppcheck will write that the scope for 'i' can be reduced: void f(int x) { int i = 0; if (x) { // it's safe to move 'int i = 0' here for (int n = 0; n < 10; ++n) { // it is possible but not safe to move 'int i = 0' here do_something(&i); } } } When you see this message it is always safe to reduce the variable scope 1 level. [compiz/compizconfig/libcompizconfig/src/compiz.cpp:1754]: (style) The scope of the variable 'name' can be reduced. Warning: It can be unsafe to fix this message. Be careful. Especially when there are inner loops. Here is an example where cppcheck will write that the scope for 'i' can be reduced: void f(int x) { int i = 0; if (x) { // it's safe to move 'int i = 0' here for (int n = 0; n < 10; ++n) { // it is possible but not safe to move 'int i = 0' here do_something(&i); } } } When you see this message it is always safe to reduce the variable scope 1 level. [compiz/compizconfig/libcompizconfig/src/compiz.cpp:1755]: (style) The scope of the variable 'value' can be reduced. Warning: It can be unsafe to fix this message. Be careful. Especially when there are inner loops. Here is an example where cppcheck will write that the scope for 'i' can be reduced: void f(int x) { int i = 0; if (x) { // it's safe to move 'int i = 0' here for (int n = 0; n < 10; ++n) { // it is possible but not safe to move 'int i = 0' here do_something(&i); } } } When you see this message it is always safe to reduce the variable scope 1 level. [compiz/compizconfig/libcompizconfig/src/compiz.cpp:1756]: (style) The scope of the variable 'j' can be reduced. Warning: It can be unsafe to fix this message. Be careful. Especially when there are inner loops. Here is an example where cppcheck will write that the scope for 'i' can be reduced: void f(int x) { int i = 0; if (x) { // it's safe to move 'int i = 0' here for (int n = 0; n < 10; ++n) { // it is possible but not safe to move 'int i = 0' here do_something(&i); } } } When you see this message it is always safe to reduce the variable scope 1 level. [compiz/compizconfig/libcompizconfig/src/compiz.cpp:2272]: (style) The scope of the variable 'i' can be reduced. Warning: It can be unsafe to fix this message. Be careful. Especially when there are inner loops. Here is an example where cppcheck will write that the scope for 'i' can be reduced: void f(int x) { int i = 0; if (x) { // it's safe to move 'int i = 0' here for (int n = 0; n < 10; ++n) { // it is possible but not safe to move 'int i = 0' here do_something(&i); } } } When you see this message it is always safe to reduce the variable scope 1 level. [compiz/compizconfig/libcompizconfig/src/compiz.cpp:2329]: (style) The scope of the variable 'i' can be reduced. Warning: It can be unsafe to fix this message. Be careful. Especially when there are inner loops. Here is an example where cppcheck will write that the scope for 'i' can be reduced: void f(int x) { int i = 0; if (x) { // it's safe to move 'int i = 0' here for (int n = 0; n < 10; ++n) { // it is possible but not safe to move 'int i = 0' here do_something(&i); } } } When you see this message it is always safe to reduce the variable scope 1 level. [compiz/compizconfig/libcompizconfig/src/compiz.cpp:3037]: (warning) scanf without field width limits can crash with huge input data. To fix this error message add a field width specifier: %s => %20s %i => %3i Sample program that can crash: #include int main() { int a; scanf("%i", &a); return 0; } To make it crash: perl -e 'print "5"x2100000' | ./a.out [compiz/compizconfig/libcompizconfig/src/compiz.cpp:346]: (style) The scope of the variable 'j' can be reduced. Warning: It can be unsafe to fix this message. Be careful. Especially when there are inner loops. Here is an example where cppcheck will write that the scope for 'i' can be reduced: void f(int x) { int i = 0; if (x) { // it's safe to move 'int i = 0' here for (int n = 0; n < 10; ++n) { // it is possible but not safe to move 'int i = 0' here do_something(&i); } } } When you see this message it is always safe to reduce the variable scope 1 level. [compiz/compizconfig/libcompizconfig/src/compiz.cpp:412]: (style) The scope of the variable 'num' can be reduced. Warning: It can be unsafe to fix this message. Be careful. Especially when there are inner loops. Here is an example where cppcheck will write that the scope for 'i' can be reduced: void f(int x) { int i = 0; if (x) { // it's safe to move 'int i = 0' here for (int n = 0; n < 10; ++n) { // it is possible but not safe to move 'int i = 0' here do_something(&i); } } } When you see this message it is always safe to reduce the variable scope 1 level. [compiz/compizconfig/libcompizconfig/src/compiz.cpp:412]: (style) The scope of the variable 'j' can be reduced. Warning: It can be unsafe to fix this message. Be careful. Especially when there are inner loops. Here is an example where cppcheck will write that the scope for 'i' can be reduced: void f(int x) { int i = 0; if (x) { // it's safe to move 'int i = 0' here for (int n = 0; n < 10; ++n) { // it is possible but not safe to move 'int i = 0' here do_something(&i); } } } When you see this message it is always safe to reduce the variable scope 1 level. [compiz/compizconfig/libcompizconfig/src/compiz.cpp:471]: (style) The scope of the variable 'num' can be reduced. Warning: It can be unsafe to fix this message. Be careful. Especially when there are inner loops. Here is an example where cppcheck will write that the scope for 'i' can be reduced: void f(int x) { int i = 0; if (x) { // it's safe to move 'int i = 0' here for (int n = 0; n < 10; ++n) { // it is possible but not safe to move 'int i = 0' here do_something(&i); } } } When you see this message it is always safe to reduce the variable scope 1 level. [compiz/compizconfig/libcompizconfig/src/compiz.cpp:471]: (style) The scope of the variable 'j' can be reduced. Warning: It can be unsafe to fix this message. Be careful. Especially when there are inner loops. Here is an example where cppcheck will write that the scope for 'i' can be reduced: void f(int x) { int i = 0; if (x) { // it's safe to move 'int i = 0' here for (int n = 0; n < 10; ++n) { // it is possible but not safe to move 'int i = 0' here do_something(&i); } } } When you see this message it is always safe to reduce the variable scope 1 level. [compiz/compizconfig/libcompizconfig/src/compiz.cpp:749]: (style) The scope of the variable 'numOpt' can be reduced. Warning: It can be unsafe to fix this message. Be careful. Especially when there are inner loops. Here is an example where cppcheck will write that the scope for 'i' can be reduced: void f(int x) { int i = 0; if (x) { // it's safe to move 'int i = 0' here for (int n = 0; n < 10; ++n) { // it is possible but not safe to move 'int i = 0' here do_something(&i); } } } When you see this message it is always safe to reduce the variable scope 1 level. [compiz/compizconfig/libcompizconfig/src/compiz.cpp:749]: (style) The scope of the variable 'i' can be reduced. Warning: It can be unsafe to fix this message. Be careful. Especially when there are inner loops. Here is an example where cppcheck will write that the scope for 'i' can be reduced: void f(int x) { int i = 0; if (x) { // it's safe to move 'int i = 0' here for (int n = 0; n < 10; ++n) { // it is possible but not safe to move 'int i = 0' here do_something(&i); } } } When you see this message it is always safe to reduce the variable scope 1 level. [compiz/compizconfig/libcompizconfig/src/compiz.cpp:2703]: (error) Memory leak: pbFile [compiz/compizconfig/libcompizconfig/src/compiz.cpp:2769]: (error) Memory leak: pbFile [compiz/compizconfig/libcompizconfig/src/compiz.cpp:771]: (performance) Prefix ++/-- operators should be preferred for non-primitive types. Pre-increment/decrement can be more efficient than post-increment/decrement. Post-increment/decrement usually involves keeping a copy of the previous value around and adds a little extra code. [compiz/compizconfig/libcompizconfig/src/filewatch.c:113]: (error) Common realloc mistake: 'fwData' nulled but not freed upon failure [compiz/compizconfig/libcompizconfig/src/filewatch.c:173]: (error) Common realloc mistake: 'fwData' nulled but not freed upon failure [compiz/compizconfig/libcompizconfig/src/ini.c:791]: (error) Common realloc mistake: 'stringBuffer' nulled but not freed upon failure [compiz/compizconfig/libcompizconfig/src/iniparser.c:123]: (style) Defensive programming: The variable i is used as array index and then there is a check that it is within limits. This can mean that the array might be accessed out-of-bounds. Reorder conditions such as '(a[i] && i < 10)' to '(i < 10 && a[i])'. That way the array will not be accessed when the index is out of limits. [compiz/compizconfig/libcompizconfig/src/main.c:656]: (error) Possible null pointer dereference: subGroup - otherwise it is redundant to check if subGroup is null at line 657 [compiz/compizconfig/libcompizconfig/src/main.c:3213]: (error) Possible null pointer dereference: conflict - otherwise it is redundant to check if conflict is null at line 3214 [compiz/compizconfig/libcompizconfig/src/main.c:4305]: (error) Read and write operations without a call to a positioning function (fseek, fsetpos or rewind) or fflush inbetween result in undefined behaviour. [compiz/compizconfig/libcompizconfig/src/main.c:259]: (error) Memory pointed to by 'val' is freed twice. [compiz/compizconfig/libcompizconfig/src/main.c:267]: (error) Memory pointed to by 'val' is freed twice. [compiz/compizconfig/libcompizconfig/src/main.c:275]: (error) Memory pointed to by 'val' is freed twice. [compiz/compizconfig/libcompizconfig/src/main.c:1037]: (error) Memory pointed to by 'dlname' is freed twice. [compiz/compizconfig/libcompizconfig/src/main.c:3485]: (error) Memory pointed to by 'backenddir' is freed twice. [compiz/compizconfig/libcompizconfig/src/main.c:3495]: (error) Memory pointed to by 'backenddir' is freed twice. [compiz/compizconfig/libcompizconfig/src/main.c:3626]: (error) Memory leak: sectionName [compiz/compizconfig/libcompizconfig/src/main.c:3784]: (error) Memory leak: sectionName [compiz/compizconfig/libcompizconfig/src/main.c:4262]: (error) Memory leak: completedUpgrades [compiz/compizconfig/libcompizconfig/src/main.c:4266]: (error) Memory leak: completedUpgrades [compiz/compizconfig/libcompizconfig/src/main.c:4262]: (error) Resource leak: completedUpgrades [compiz/compizconfig/libcompizconfig/tests/mock-context.h:94]: (style) C-style pointer casting [compiz/compizconfig/libcompizconfig/tests/mock-context.h:100]: (style) C-style pointer casting [compiz/compizconfig/libcompizconfig/tests/mock-context.h:106]: (style) C-style pointer casting [compiz/compizconfig/libcompizconfig/tests/mock-context.h:112]: (style) C-style pointer casting [compiz/compizconfig/libcompizconfig/tests/mock-context.h:118]: (style) C-style pointer casting [compiz/compizconfig/libcompizconfig/tests/mock-context.h:124]: (style) C-style pointer casting [compiz/compizconfig/libcompizconfig/tests/mock-context.h:130]: (style) C-style pointer casting [compiz/compizconfig/libcompizconfig/tests/mock-context.h:136]: (style) C-style pointer casting [compiz/compizconfig/libcompizconfig/tests/mock-context.h:142]: (style) C-style pointer casting [compiz/compizconfig/libcompizconfig/tests/mock-context.h:148]: (style) C-style pointer casting [compiz/compizconfig/libcompizconfig/tests/mock-context.h:154]: (style) C-style pointer casting [compiz/compizconfig/libcompizconfig/tests/mock-context.h:160]: (style) C-style pointer casting [compiz/compizconfig/libcompizconfig/tests/mock-context.h:166]: (style) C-style pointer casting [compiz/compizconfig/libcompizconfig/tests/mock-context.h:172]: (style) C-style pointer casting [compiz/compizconfig/libcompizconfig/tests/mock-context.h:178]: (style) C-style pointer casting [compiz/compizconfig/libcompizconfig/tests/mock-context.h:187]: (style) C-style pointer casting [compiz/compizconfig/libcompizconfig/tests/mock-context.h:196]: (style) C-style pointer casting [compiz/compizconfig/libcompizconfig/tests/mock-context.h:205]: (style) C-style pointer casting [compiz/compizconfig/libcompizconfig/tests/mock-context.h:211]: (style) C-style pointer casting [compiz/compizconfig/libcompizconfig/tests/mock-context.h:217]: (style) C-style pointer casting [compiz/compizconfig/libcompizconfig/tests/mock-context.h:223]: (style) C-style pointer casting [compiz/compizconfig/libcompizconfig/tests/mock-context.h:232]: (style) C-style pointer casting [compiz/compizconfig/libcompizconfig/tests/mock-context.h:241]: (style) C-style pointer casting [compiz/compizconfig/libcompizconfig/tests/mock-context.h:250]: (style) C-style pointer casting [compiz/compizconfig/libcompizconfig/tests/mock-context.h:259]: (style) C-style pointer casting [compiz/compizconfig/libcompizconfig/tests/mock-context.h:265]: (style) C-style pointer casting [compiz/compizconfig/libcompizconfig/tests/mock-context.h:271]: (style) C-style pointer casting [compiz/compizconfig/libcompizconfig/tests/mock-context.h:280]: (style) C-style pointer casting [compiz/compizconfig/libcompizconfig/tests/mock-context.h:289]: (style) C-style pointer casting [compiz/compizconfig/libcompizconfig/tests/mock-context.h:295]: (style) C-style pointer casting [compiz/compizconfig/libcompizconfig/tests/mock-context.h:304]: (style) C-style pointer casting [compiz/compizconfig/libcompizconfig/tests/mock-context.h:313]: (style) C-style pointer casting [compiz/compizconfig/libcompizconfig/tests/mock-context.h:322]: (style) C-style pointer casting [compiz/compizconfig/libcompizconfig/tests/mock-context.h:331]: (style) C-style pointer casting [compiz/compizconfig/libcompizconfig/tests/context-mock.cpp:68]: (style) C-style pointer casting [compiz/compizconfig/libcompizconfig/tests/mock-plugin.h:64]: (style) C-style pointer casting [compiz/compizconfig/libcompizconfig/tests/mock-plugin.h:69]: (style) C-style pointer casting [compiz/compizconfig/libcompizconfig/tests/mock-plugin.h:74]: (style) C-style pointer casting [compiz/compizconfig/libcompizconfig/tests/mock-plugin.h:79]: (style) C-style pointer casting [compiz/compizconfig/libcompizconfig/tests/mock-plugin.h:84]: (style) C-style pointer casting [compiz/compizconfig/libcompizconfig/tests/mock-plugin.h:89]: (style) C-style pointer casting [compiz/compizconfig/libcompizconfig/tests/mock-plugin.h:94]: (style) C-style pointer casting [compiz/compizconfig/libcompizconfig/tests/mock-plugin.h:99]: (style) C-style pointer casting [compiz/compizconfig/libcompizconfig/tests/mock-plugin.h:104]: (style) C-style pointer casting [compiz/compizconfig/libcompizconfig/tests/mock-plugin.h:109]: (style) C-style pointer casting [compiz/compizconfig/libcompizconfig/tests/mock-plugin.h:114]: (style) C-style pointer casting [compiz/compizconfig/libcompizconfig/tests/mock-plugin.h:119]: (style) C-style pointer casting [compiz/compizconfig/libcompizconfig/tests/mock-plugin.h:124]: (style) C-style pointer casting [compiz/compizconfig/libcompizconfig/tests/mock-plugin.h:129]: (style) C-style pointer casting [compiz/compizconfig/libcompizconfig/tests/mock-plugin.h:134]: (style) C-style pointer casting [compiz/compizconfig/libcompizconfig/tests/mock-plugin.h:139]: (style) C-style pointer casting [compiz/compizconfig/libcompizconfig/tests/mock-plugin.h:148]: (style) C-style pointer casting [compiz/compizconfig/libcompizconfig/tests/mock-plugin.h:154]: (style) C-style pointer casting [compiz/compizconfig/libcompizconfig/tests/mock-plugin.h:159]: (style) C-style pointer casting [compiz/compizconfig/libcompizconfig/tests/plugin-mock.cpp:55]: (style) C-style pointer casting [compiz/compizconfig/libcompizconfig/tests/mock-setting.h:119]: (style) C-style pointer casting [compiz/compizconfig/libcompizconfig/tests/mock-setting.h:125]: (style) C-style pointer casting [compiz/compizconfig/libcompizconfig/tests/mock-setting.h:131]: (style) C-style pointer casting [compiz/compizconfig/libcompizconfig/tests/mock-setting.h:137]: (style) C-style pointer casting [compiz/compizconfig/libcompizconfig/tests/mock-setting.h:143]: (style) C-style pointer casting [compiz/compizconfig/libcompizconfig/tests/mock-setting.h:149]: (style) C-style pointer casting [compiz/compizconfig/libcompizconfig/tests/mock-setting.h:155]: (style) C-style pointer casting [compiz/compizconfig/libcompizconfig/tests/mock-setting.h:161]: (style) C-style pointer casting [compiz/compizconfig/libcompizconfig/tests/mock-setting.h:167]: (style) C-style pointer casting [compiz/compizconfig/libcompizconfig/tests/mock-setting.h:173]: (style) C-style pointer casting [compiz/compizconfig/libcompizconfig/tests/mock-setting.h:179]: (style) C-style pointer casting [compiz/compizconfig/libcompizconfig/tests/mock-setting.h:186]: (style) C-style pointer casting [compiz/compizconfig/libcompizconfig/tests/mock-setting.h:193]: (style) C-style pointer casting [compiz/compizconfig/libcompizconfig/tests/mock-setting.h:200]: (style) C-style pointer casting [compiz/compizconfig/libcompizconfig/tests/mock-setting.h:207]: (style) C-style pointer casting [compiz/compizconfig/libcompizconfig/tests/mock-setting.h:214]: (style) C-style pointer casting [compiz/compizconfig/libcompizconfig/tests/mock-setting.h:221]: (style) C-style pointer casting [compiz/compizconfig/libcompizconfig/tests/mock-setting.h:228]: (style) C-style pointer casting [compiz/compizconfig/libcompizconfig/tests/mock-setting.h:235]: (style) C-style pointer casting [compiz/compizconfig/libcompizconfig/tests/mock-setting.h:242]: (style) C-style pointer casting [compiz/compizconfig/libcompizconfig/tests/mock-setting.h:249]: (style) C-style pointer casting [compiz/compizconfig/libcompizconfig/tests/mock-setting.h:256]: (style) C-style pointer casting [compiz/compizconfig/libcompizconfig/tests/mock-setting.h:263]: (style) C-style pointer casting [compiz/compizconfig/libcompizconfig/tests/mock-setting.h:268]: (style) C-style pointer casting [compiz/compizconfig/libcompizconfig/tests/mock-setting.h:273]: (style) C-style pointer casting [compiz/compizconfig/libcompizconfig/tests/mock-setting.h:278]: (style) C-style pointer casting [compiz/compizconfig/libcompizconfig/tests/mock-setting.h:283]: (style) C-style pointer casting [compiz/compizconfig/libcompizconfig/tests/mock-setting.h:289]: (style) C-style pointer casting [compiz/compizconfig/libcompizconfig/tests/mock-setting.h:294]: (style) C-style pointer casting [compiz/compizconfig/libcompizconfig/tests/mock-setting.h:299]: (style) C-style pointer casting [compiz/compizconfig/libcompizconfig/tests/mock-setting.h:304]: (style) C-style pointer casting [compiz/compizconfig/libcompizconfig/tests/mock-setting.h:309]: (style) C-style pointer casting [compiz/compizconfig/libcompizconfig/tests/mock-setting.h:314]: (style) C-style pointer casting [compiz/compizconfig/libcompizconfig/tests/mock-setting.h:319]: (style) C-style pointer casting [compiz/compizconfig/libcompizconfig/tests/mock-setting.h:324]: (style) C-style pointer casting [compiz/compizconfig/libcompizconfig/tests/mock-setting.h:329]: (style) C-style pointer casting [compiz/compizconfig/libcompizconfig/tests/mock-setting.h:334]: (style) C-style pointer casting [compiz/compizconfig/libcompizconfig/tests/mock-setting.h:339]: (style) C-style pointer casting [compiz/compizconfig/libcompizconfig/tests/mock-setting.h:344]: (style) C-style pointer casting [compiz/compizconfig/libcompizconfig/tests/mock-setting.h:349]: (style) C-style pointer casting [compiz/compizconfig/libcompizconfig/tests/setting-mock.cpp:77]: (style) C-style pointer casting [compiz/compizconfig/libcompizconfig/tests/test-ccs-object.cpp:86]: (style) C-style pointer casting [compiz/compizconfig/libcompizconfig/tests/test-ccs-object.cpp:100]: (style) C-style pointer casting [compiz/compizconfig/libcompizconfig/tests/test-ccs-object.cpp:120]: (style) C-style pointer casting [compiz/compizconfig/libcompizconfig/tests/test-ccs-object.cpp:129]: (style) C-style pointer casting [compiz/compizconfig/libcompizconfig/tests/test-ccs-object.cpp:146]: (style) C-style pointer casting [compiz/compizconfig/libcompizconfig/tests/test-ccs-object.cpp:180]: (style) C-style pointer casting [compiz/compizconfig/libcompizconfig/tests/test-ccs-object.cpp:192]: (style) C-style pointer casting [compiz/compizconfig/libcompizconfig/tests/test-ccs-object.cpp:299]: (style) C-style pointer casting [compiz/compizconfig/libcompizconfig/tests/test-ccs-object.cpp:327]: (style) C-style pointer casting [compiz/compizconfig/libcompizconfig/tests/test-context.cpp:19]: (style) C-style pointer casting [compiz/compizconfig/libcompizconfig/tests/test-plugin.cpp:19]: (style) C-style pointer casting [compiz/compizconfig/libcompizconfig/tests/test-setting.cpp:19]: (style) C-style pointer casting [compiz/gtk/window-decorator/cairo.c:732] -> [compiz/gtk/window-decorator/cairo.c:732]: (style) Finding the same expression on both sides of an operator is suspicious and might indicate a cut and paste or logic error. Please examine this code carefully to determine if it is correct. [compiz/gtk/window-decorator/decorator.c:1016]: (error) Memory leak: opts [compiz/gtk/window-decorator/events.c:443]: (style) The scope of the variable 'last_button_num' can be reduced. Warning: It can be unsafe to fix this message. Be careful. Especially when there are inner loops. Here is an example where cppcheck will write that the scope for 'i' can be reduced: void f(int x) { int i = 0; if (x) { // it's safe to move 'int i = 0' here for (int n = 0; n < 10; ++n) { // it is possible but not safe to move 'int i = 0' here do_something(&i); } } } When you see this message it is always safe to reduce the variable scope 1 level. [compiz/gtk/window-decorator/events.c:446]: (style) The scope of the variable 'last_button_x' can be reduced. Warning: It can be unsafe to fix this message. Be careful. Especially when there are inner loops. Here is an example where cppcheck will write that the scope for 'i' can be reduced: void f(int x) { int i = 0; if (x) { // it's safe to move 'int i = 0' here for (int n = 0; n < 10; ++n) { // it is possible but not safe to move 'int i = 0' here do_something(&i); } } } When you see this message it is always safe to reduce the variable scope 1 level. [compiz/gtk/window-decorator/events.c:447]: (style) The scope of the variable 'last_button_y' can be reduced. Warning: It can be unsafe to fix this message. Be careful. Especially when there are inner loops. Here is an example where cppcheck will write that the scope for 'i' can be reduced: void f(int x) { int i = 0; if (x) { // it's safe to move 'int i = 0' here for (int n = 0; n < 10; ++n) { // it is possible but not safe to move 'int i = 0' here do_something(&i); } } } When you see this message it is always safe to reduce the variable scope 1 level. [compiz/gtk/window-decorator/frames.c:266]: (error) Possible null pointer dereference: frame - otherwise it is redundant to check if frame is null at line 296 [compiz/gtk/window-decorator/frames.c:269]: (error) Possible null pointer dereference: frame - otherwise it is redundant to check if frame is null at line 296 [compiz/gtk/window-decorator/frames.c:272]: (error) Possible null pointer dereference: frame - otherwise it is redundant to check if frame is null at line 296 [compiz/gtk/window-decorator/frames.c:275]: (error) Possible null pointer dereference: frame - otherwise it is redundant to check if frame is null at line 296 [compiz/gtk/window-decorator/frames.c:278]: (error) Possible null pointer dereference: frame - otherwise it is redundant to check if frame is null at line 296 [compiz/gtk/window-decorator/frames.c:281]: (error) Possible null pointer dereference: frame - otherwise it is redundant to check if frame is null at line 296 [compiz/gtk/window-decorator/frames.c:284]: (error) Possible null pointer dereference: frame - otherwise it is redundant to check if frame is null at line 296 [compiz/gtk/window-decorator/frames.c:287]: (error) Possible null pointer dereference: frame - otherwise it is redundant to check if frame is null at line 296 [compiz/gtk/window-decorator/frames.c:290]: (error) Possible null pointer dereference: frame - otherwise it is redundant to check if frame is null at line 296 [compiz/gtk/window-decorator/frames.c:293]: (error) Possible null pointer dereference: frame - otherwise it is redundant to check if frame is null at line 296 [compiz/gtk/window-decorator/metacity.c:599]: (style) Variable 'frame_style' is assigned a value that is never used [compiz/kde/window-decorator-kde4/switcher.cpp:227]: (style) Variable 'frameType' is assigned a value that is never used [compiz/kde/window-decorator-kde4/switcher.cpp:227]: (style) Variable 'frameState' is assigned a value that is never used [compiz/kde/window-decorator-kde4/switcher.cpp:227]: (style) Variable 'frameActions' is assigned a value that is never used [compiz/kde/window-decorator-kde4/window.cpp:1153]: (style) The scope of the variable 'nQuad' can be reduced. Warning: It can be unsafe to fix this message. Be careful. Especially when there are inner loops. Here is an example where cppcheck will write that the scope for 'i' can be reduced: void f(int x) { int i = 0; if (x) { // it's safe to move 'int i = 0' here for (int n = 0; n < 10; ++n) { // it is possible but not safe to move 'int i = 0' here do_something(&i); } } } When you see this message it is always safe to reduce the variable scope 1 level. [compiz/libdecoration/decoration.c:3140]: (style) The scope of the variable 'icccm_version' can be reduced. Warning: It can be unsafe to fix this message. Be careful. Especially when there are inner loops. Here is an example where cppcheck will write that the scope for 'i' can be reduced: void f(int x) { int i = 0; if (x) { // it's safe to move 'int i = 0' here for (int n = 0; n < 10; ++n) { // it is possible but not safe to move 'int i = 0' here do_something(&i); } } } When you see this message it is always safe to reduce the variable scope 1 level. [compiz/plugins/animation/src/animation.cpp:599]: (style) The scope of the variable 'nFirstRandomEffect' can be reduced. Warning: It can be unsafe to fix this message. Be careful. Especially when there are inner loops. Here is an example where cppcheck will write that the scope for 'i' can be reduced: void f(int x) { int i = 0; if (x) { // it's safe to move 'int i = 0' here for (int n = 0; n < 10; ++n) { // it is possible but not safe to move 'int i = 0' here do_something(&i); } } } When you see this message it is always safe to reduce the variable scope 1 level. [compiz/plugins/animation/src/animation.cpp:981]: (performance) Checking for 'mExtensionPlugins' emptiness might be inefficient. Using mExtensionPlugins.empty() instead of mExtensionPlugins.size() can be faster. mExtensionPlugins.size() can take linear time but mExtensionPlugins.empty() is guaranteed to take constant time. [compiz/plugins/animation/src/animation.cpp:991]: (performance) Checking for 'mExtensionPlugins' emptiness might be inefficient. Using mExtensionPlugins.empty() instead of mExtensionPlugins.size() can be faster. mExtensionPlugins.size() can take linear time but mExtensionPlugins.empty() is guaranteed to take constant time. [compiz/plugins/animation/src/animation.cpp:1000]: (performance) Checking for 'mExtensionPlugins' emptiness might be inefficient. Using mExtensionPlugins.empty() instead of mExtensionPlugins.size() can be faster. mExtensionPlugins.size() can take linear time but mExtensionPlugins.empty() is guaranteed to take constant time. [compiz/plugins/animation/src/animation.cpp:1009]: (performance) Checking for 'mExtensionPlugins' emptiness might be inefficient. Using mExtensionPlugins.empty() instead of mExtensionPlugins.size() can be faster. mExtensionPlugins.size() can take linear time but mExtensionPlugins.empty() is guaranteed to take constant time. [compiz/plugins/animation/src/animation.cpp:1270]: (performance) Prefix ++/-- operators should be preferred for non-primitive types. Pre-increment/decrement can be more efficient than post-increment/decrement. Post-increment/decrement usually involves keeping a copy of the previous value around and adds a little extra code. [compiz/plugins/animation/src/animation.cpp:1386]: (performance) Prefix ++/-- operators should be preferred for non-primitive types. Pre-increment/decrement can be more efficient than post-increment/decrement. Post-increment/decrement usually involves keeping a copy of the previous value around and adds a little extra code. [compiz/plugins/animation/src/animation.cpp:2934]: (performance) Prefix ++/-- operators should be preferred for non-primitive types. Pre-increment/decrement can be more efficient than post-increment/decrement. Post-increment/decrement usually involves keeping a copy of the previous value around and adds a little extra code. [compiz/plugins/animation/src/extensionplugin.cpp:436]: (style) Defensive programming: The variable changeEnd is used as array index and then there is a check that it is within limits. This can mean that the array might be accessed out-of-bounds. Reorder conditions such as '(a[i] && i < 10)' to '(i < 10 && a[i])'. That way the array will not be accessed when the index is out of limits. [compiz/plugins/animation/src/extensionplugin.cpp:152]: (performance) Prefix ++/-- operators should be preferred for non-primitive types. Pre-increment/decrement can be more efficient than post-increment/decrement. Post-increment/decrement usually involves keeping a copy of the previous value around and adds a little extra code. [compiz/plugins/animation/src/extensionplugin.cpp:230]: (performance) Prefix ++/-- operators should be preferred for non-primitive types. Pre-increment/decrement can be more efficient than post-increment/decrement. Post-increment/decrement usually involves keeping a copy of the previous value around and adds a little extra code. [compiz/plugins/animation/src/extensionplugin.cpp:277]: (performance) Prefix ++/-- operators should be preferred for non-primitive types. Pre-increment/decrement can be more efficient than post-increment/decrement. Post-increment/decrement usually involves keeping a copy of the previous value around and adds a little extra code. [compiz/plugins/animation/src/glide.cpp:41]: (warning) Member variable 'GlideAnim::glideModRotAngle' is not initialized in the constructor. [compiz/plugins/animation/src/magiclamp.cpp:55]: (warning) Member variable 'MagicLampAnim::mTopLeftCornerObject' is not initialized in the constructor. [compiz/plugins/animation/src/magiclamp.cpp:55]: (warning) Member variable 'MagicLampAnim::mBottomLeftCornerObject' is not initialized in the constructor. [compiz/plugins/animation/src/options.cpp:127]: (warning) scanf without field width limits can crash with huge input data. To fix this error message add a field width specifier: %s => %20s %i => %3i Sample program that can crash: #include int main() { int a; scanf("%i", &a); return 0; } To make it crash: perl -e 'print "5"x2100000' | ./a.out [compiz/plugins/animation/src/options.cpp:169]: (warning) scanf without field width limits can crash with huge input data. To fix this error message add a field width specifier: %s => %20s %i => %3i Sample program that can crash: #include int main() { int a; scanf("%i", &a); return 0; } To make it crash: perl -e 'print "5"x2100000' | ./a.out [compiz/plugins/animation/src/options.cpp:224]: (warning) scanf without field width limits can crash with huge input data. To fix this error message add a field width specifier: %s => %20s %i => %3i Sample program that can crash: #include int main() { int a; scanf("%i", &a); return 0; } To make it crash: perl -e 'print "5"x2100000' | ./a.out [compiz/plugins/animation/src/options.cpp:231]: (warning) scanf without field width limits can crash with huge input data. To fix this error message add a field width specifier: %s => %20s %i => %3i Sample program that can crash: #include int main() { int a; scanf("%i", &a); return 0; } To make it crash: perl -e 'print "5"x2100000' | ./a.out [compiz/plugins/animation/src/options.cpp:247]: (warning) scanf without field width limits can crash with huge input data. To fix this error message add a field width specifier: %s => %20s %i => %3i Sample program that can crash: #include int main() { int a; scanf("%i", &a); return 0; } To make it crash: perl -e 'print "5"x2100000' | ./a.out [compiz/plugins/animationaddon/src/airplane.cpp:127]: (style) C-style pointer casting [compiz/plugins/animationaddon/src/airplane.cpp:348]: (style) C-style pointer casting [compiz/plugins/animationaddon/src/airplane.cpp:533]: (style) C-style pointer casting [compiz/plugins/animationaddon/src/airplane.cpp:697]: (style) C-style pointer casting [compiz/plugins/animationaddon/src/airplane.cpp:747]: (style) C-style pointer casting [compiz/plugins/animationaddon/src/private.h:41]: (warning) Member variable 'ExtensionPluginAnimAddon::mOutput' is not initialized in the constructor. [compiz/plugins/animationaddon/src/burn.cpp:395]: (style) The scope of the variable 'nParticles' can be reduced. Warning: It can be unsafe to fix this message. Be careful. Especially when there are inner loops. Here is an example where cppcheck will write that the scope for 'i' can be reduced: void f(int x) { int i = 0; if (x) { // it's safe to move 'int i = 0' here for (int n = 0; n < 10; ++n) { // it is possible but not safe to move 'int i = 0' here do_something(&i); } } } When you see this message it is always safe to reduce the variable scope 1 level. [compiz/plugins/animationaddon/src/polygon.cpp:459]: (style) Suspicious calculation. Please use parentheses to clarify the code. The code 'a%b?c:d' should be written as either '(a%b)?c:d' or 'a%(b?c:d)'. [compiz/plugins/annotate/src/annotate.cpp:782]: (style) The scope of the variable 'clearColor' can be reduced. Warning: It can be unsafe to fix this message. Be careful. Especially when there are inner loops. Here is an example where cppcheck will write that the scope for 'i' can be reduced: void f(int x) { int i = 0; if (x) { // it's safe to move 'int i = 0' here for (int n = 0; n < 10; ++n) { // it is possible but not safe to move 'int i = 0' here do_something(&i); } } } When you see this message it is always safe to reduce the variable scope 1 level. [compiz/plugins/ccp/src/ccp.cpp:196]: (style) The scope of the variable 'i' can be reduced. Warning: It can be unsafe to fix this message. Be careful. Especially when there are inner loops. Here is an example where cppcheck will write that the scope for 'i' can be reduced: void f(int x) { int i = 0; if (x) { // it's safe to move 'int i = 0' here for (int n = 0; n < 10; ++n) { // it is possible but not safe to move 'int i = 0' here do_something(&i); } } } When you see this message it is always safe to reduce the variable scope 1 level. [compiz/plugins/clone/src/clone.cpp:379]: (performance) Prefix ++/-- operators should be preferred for non-primitive types. Pre-increment/decrement can be more efficient than post-increment/decrement. Post-increment/decrement usually involves keeping a copy of the previous value around and adds a little extra code. [compiz/plugins/clone/src/clone.cpp:536]: (performance) Prefix ++/-- operators should be preferred for non-primitive types. Pre-increment/decrement can be more efficient than post-increment/decrement. Post-increment/decrement usually involves keeping a copy of the previous value around and adds a little extra code. [compiz/plugins/colorfilter/src/colorfilter.cpp:252]: (error) Possible null pointer dereference: func - otherwise it is redundant to check if func is null at line 255 [compiz/plugins/colorfilter/src/parser.h:34]: (style) The class 'FragmentParser 'does not have a constructor but it has attributes. The attributes are not initialized which may cause bugs or undefined behavior. [compiz/plugins/colorfilter/src/colorfilter.cpp:301]: (performance) Checking for 'filtersFunctions' emptiness might be inefficient. Using filtersFunctions.empty() instead of filtersFunctions.size() can be faster. filtersFunctions.size() can take linear time but filtersFunctions.empty() is guaranteed to take constant time. [compiz/plugins/colorfilter/src/parser.cpp:152]: (style) The scope of the variable 'temp' can be reduced. Warning: It can be unsafe to fix this message. Be careful. Especially when there are inner loops. Here is an example where cppcheck will write that the scope for 'i' can be reduced: void f(int x) { int i = 0; if (x) { // it's safe to move 'int i = 0' here for (int n = 0; n < 10; ++n) { // it is possible but not safe to move 'int i = 0' here do_something(&i); } } } When you see this message it is always safe to reduce the variable scope 1 level. [compiz/plugins/colorfilter/src/parser.cpp:176]: (style) Suspicious condition (assignment+comparison), it can be clarified with parentheses [compiz/plugins/colorfilter/src/parser.cpp:177]: (style) Suspicious condition (assignment+comparison), it can be clarified with parentheses [compiz/plugins/colorfilter/src/parser.cpp:438]: (performance) Checking for 'offsets' emptiness might be inefficient. Using offsets.empty() instead of offsets.size() can be faster. offsets.size() can take linear time but offsets.empty() is guaranteed to take constant time. [compiz/plugins/compiztoolbox/src/compiztoolbox.cpp:270]: (performance) Prefix ++/-- operators should be preferred for non-primitive types. Pre-increment/decrement can be more efficient than post-increment/decrement. Post-increment/decrement usually involves keeping a copy of the previous value around and adds a little extra code. [compiz/plugins/compiztoolbox/src/compiztoolbox.cpp:281]: (performance) Prefix ++/-- operators should be preferred for non-primitive types. Pre-increment/decrement can be more efficient than post-increment/decrement. Post-increment/decrement usually involves keeping a copy of the previous value around and adds a little extra code. [compiz/plugins/composite/src/screen.cpp:276]: (warning) Member variable 'PrivateCompositeScreen::compositeEvent' is not initialized in the constructor. [compiz/plugins/composite/src/screen.cpp:276]: (warning) Member variable 'PrivateCompositeScreen::compositeError' is not initialized in the constructor. [compiz/plugins/composite/src/screen.cpp:276]: (warning) Member variable 'PrivateCompositeScreen::compositeOpcode' is not initialized in the constructor. [compiz/plugins/composite/src/screen.cpp:276]: (warning) Member variable 'PrivateCompositeScreen::damageEvent' is not initialized in the constructor. [compiz/plugins/composite/src/screen.cpp:276]: (warning) Member variable 'PrivateCompositeScreen::damageError' is not initialized in the constructor. [compiz/plugins/composite/src/screen.cpp:276]: (warning) Member variable 'PrivateCompositeScreen::fixesEvent' is not initialized in the constructor. [compiz/plugins/composite/src/screen.cpp:276]: (warning) Member variable 'PrivateCompositeScreen::fixesError' is not initialized in the constructor. [compiz/plugins/composite/src/screen.cpp:276]: (warning) Member variable 'PrivateCompositeScreen::fixesVersion' is not initialized in the constructor. [compiz/plugins/composite/src/screen.cpp:276]: (warning) Member variable 'PrivateCompositeScreen::shapeExtension' is not initialized in the constructor. [compiz/plugins/composite/src/screen.cpp:276]: (warning) Member variable 'PrivateCompositeScreen::shapeEvent' is not initialized in the constructor. [compiz/plugins/composite/src/screen.cpp:276]: (warning) Member variable 'PrivateCompositeScreen::shapeError' is not initialized in the constructor. [compiz/plugins/composite/src/screen.cpp:276]: (warning) Member variable 'PrivateCompositeScreen::randrExtension' is not initialized in the constructor. [compiz/plugins/composite/src/screen.cpp:276]: (warning) Member variable 'PrivateCompositeScreen::randrEvent' is not initialized in the constructor. [compiz/plugins/composite/src/screen.cpp:276]: (warning) Member variable 'PrivateCompositeScreen::randrError' is not initialized in the constructor. [compiz/plugins/composite/src/screen.cpp:576]: (performance) Prefix ++/-- operators should be preferred for non-primitive types. Pre-increment/decrement can be more efficient than post-increment/decrement. Post-increment/decrement usually involves keeping a copy of the previous value around and adds a little extra code. [compiz/plugins/composite/src/screen.cpp:773]: (performance) Prefix ++/-- operators should be preferred for non-primitive types. Pre-increment/decrement can be more efficient than post-increment/decrement. Post-increment/decrement usually involves keeping a copy of the previous value around and adds a little extra code. [compiz/plugins/composite/src/screen.cpp:803]: (performance) Prefix ++/-- operators should be preferred for non-primitive types. Pre-increment/decrement can be more efficient than post-increment/decrement. Post-increment/decrement usually involves keeping a copy of the previous value around and adds a little extra code. [compiz/plugins/cubeaddon/src/cubeaddon.cpp:614]: (style) The scope of the variable 'cLast' can be reduced. Warning: It can be unsafe to fix this message. Be careful. Especially when there are inner loops. Here is an example where cppcheck will write that the scope for 'i' can be reduced: void f(int x) { int i = 0; if (x) { // it's safe to move 'int i = 0' here for (int n = 0; n < 10; ++n) { // it is possible but not safe to move 'int i = 0' here do_something(&i); } } } When you see this message it is always safe to reduce the variable scope 1 level. [compiz/plugins/cubeaddon/src/cubeaddon.cpp:615]: (style) The scope of the variable 'lastX' can be reduced. Warning: It can be unsafe to fix this message. Be careful. Especially when there are inner loops. Here is an example where cppcheck will write that the scope for 'i' can be reduced: void f(int x) { int i = 0; if (x) { // it's safe to move 'int i = 0' here for (int n = 0; n < 10; ++n) { // it is possible but not safe to move 'int i = 0' here do_something(&i); } } } When you see this message it is always safe to reduce the variable scope 1 level. [compiz/plugins/cubeaddon/src/cubeaddon.cpp:615]: (style) The scope of the variable 'lastZ' can be reduced. Warning: It can be unsafe to fix this message. Be careful. Especially when there are inner loops. Here is an example where cppcheck will write that the scope for 'i' can be reduced: void f(int x) { int i = 0; if (x) { // it's safe to move 'int i = 0' here for (int n = 0; n < 10; ++n) { // it is possible but not safe to move 'int i = 0' here do_something(&i); } } } When you see this message it is always safe to reduce the variable scope 1 level. [compiz/plugins/cubeaddon/src/cubeaddon.cpp:618]: (style) The scope of the variable 'a1' can be reduced. Warning: It can be unsafe to fix this message. Be careful. Especially when there are inner loops. Here is an example where cppcheck will write that the scope for 'i' can be reduced: void f(int x) { int i = 0; if (x) { // it's safe to move 'int i = 0' here for (int n = 0; n < 10; ++n) { // it is possible but not safe to move 'int i = 0' here do_something(&i); } } } When you see this message it is always safe to reduce the variable scope 1 level. [compiz/plugins/cubeaddon/src/cubeaddon.cpp:618]: (style) The scope of the variable 'a2' can be reduced. Warning: It can be unsafe to fix this message. Be careful. Especially when there are inner loops. Here is an example where cppcheck will write that the scope for 'i' can be reduced: void f(int x) { int i = 0; if (x) { // it's safe to move 'int i = 0' here for (int n = 0; n < 10; ++n) { // it is possible but not safe to move 'int i = 0' here do_something(&i); } } } When you see this message it is always safe to reduce the variable scope 1 level. [compiz/plugins/cubeaddon/src/cubeaddon.cpp:618]: (style) The scope of the variable 'vpx' can be reduced. Warning: It can be unsafe to fix this message. Be careful. Especially when there are inner loops. Here is an example where cppcheck will write that the scope for 'i' can be reduced: void f(int x) { int i = 0; if (x) { // it's safe to move 'int i = 0' here for (int n = 0; n < 10; ++n) { // it is possible but not safe to move 'int i = 0' here do_something(&i); } } } When you see this message it is always safe to reduce the variable scope 1 level. [compiz/plugins/cubeaddon/src/cubeaddon.cpp:618]: (style) The scope of the variable 'vpy' can be reduced. Warning: It can be unsafe to fix this message. Be careful. Especially when there are inner loops. Here is an example where cppcheck will write that the scope for 'i' can be reduced: void f(int x) { int i = 0; if (x) { // it's safe to move 'int i = 0' here for (int n = 0; n < 10; ++n) { // it is possible but not safe to move 'int i = 0' here do_something(&i); } } } When you see this message it is always safe to reduce the variable scope 1 level. [compiz/plugins/cubeaddon/src/cubeaddon.cpp:619]: (style) The scope of the variable 'iang' can be reduced. Warning: It can be unsafe to fix this message. Be careful. Especially when there are inner loops. Here is an example where cppcheck will write that the scope for 'i' can be reduced: void f(int x) { int i = 0; if (x) { // it's safe to move 'int i = 0' here for (int n = 0; n < 10; ++n) { // it is possible but not safe to move 'int i = 0' here do_something(&i); } } } When you see this message it is always safe to reduce the variable scope 1 level. [compiz/plugins/cubeaddon/src/cubeaddon.cpp:1004]: (style) The scope of the variable 'i' can be reduced. Warning: It can be unsafe to fix this message. Be careful. Especially when there are inner loops. Here is an example where cppcheck will write that the scope for 'i' can be reduced: void f(int x) { int i = 0; if (x) { // it's safe to move 'int i = 0' here for (int n = 0; n < 10; ++n) { // it is possible but not safe to move 'int i = 0' here do_something(&i); } } } When you see this message it is always safe to reduce the variable scope 1 level. [compiz/plugins/cubeaddon/src/cubeaddon.cpp:1005]: (style) The scope of the variable 'w' can be reduced. Warning: It can be unsafe to fix this message. Be careful. Especially when there are inner loops. Here is an example where cppcheck will write that the scope for 'i' can be reduced: void f(int x) { int i = 0; if (x) { // it's safe to move 'int i = 0' here for (int n = 0; n < 10; ++n) { // it is possible but not safe to move 'int i = 0' here do_something(&i); } } } When you see this message it is always safe to reduce the variable scope 1 level. [compiz/plugins/dbus/src/dbus.cpp:1528]: (performance) Checking for 'path' emptiness might be inefficient. Using path.empty() instead of path.size() can be faster. path.size() can take linear time but path.empty() is guaranteed to take constant time. [compiz/plugins/dbus/src/dbus.cpp:214]: (performance) Prefix ++/-- operators should be preferred for non-primitive types. Pre-increment/decrement can be more efficient than post-increment/decrement. Post-increment/decrement usually involves keeping a copy of the previous value around and adds a little extra code. [compiz/plugins/decor/src/clip-groups/tests/clip-groups/src/test-decor-clip-groups.cpp:137]: (performance) Prefix ++/-- operators should be preferred for non-primitive types. Pre-increment/decrement can be more efficient than post-increment/decrement. Post-increment/decrement usually involves keeping a copy of the previous value around and adds a little extra code. [compiz/plugins/decor/src/decor.cpp:612]: (style) The scope of the variable 'left' can be reduced. Warning: It can be unsafe to fix this message. Be careful. Especially when there are inner loops. Here is an example where cppcheck will write that the scope for 'i' can be reduced: void f(int x) { int i = 0; if (x) { // it's safe to move 'int i = 0' here for (int n = 0; n < 10; ++n) { // it is possible but not safe to move 'int i = 0' here do_something(&i); } } } When you see this message it is always safe to reduce the variable scope 1 level. [compiz/plugins/decor/src/decor.cpp:612]: (style) The scope of the variable 'right' can be reduced. Warning: It can be unsafe to fix this message. Be careful. Especially when there are inner loops. Here is an example where cppcheck will write that the scope for 'i' can be reduced: void f(int x) { int i = 0; if (x) { // it's safe to move 'int i = 0' here for (int n = 0; n < 10; ++n) { // it is possible but not safe to move 'int i = 0' here do_something(&i); } } } When you see this message it is always safe to reduce the variable scope 1 level. [compiz/plugins/decor/src/decor.cpp:612]: (style) The scope of the variable 'top' can be reduced. Warning: It can be unsafe to fix this message. Be careful. Especially when there are inner loops. Here is an example where cppcheck will write that the scope for 'i' can be reduced: void f(int x) { int i = 0; if (x) { // it's safe to move 'int i = 0' here for (int n = 0; n < 10; ++n) { // it is possible but not safe to move 'int i = 0' here do_something(&i); } } } When you see this message it is always safe to reduce the variable scope 1 level. [compiz/plugins/decor/src/decor.cpp:612]: (style) The scope of the variable 'bottom' can be reduced. Warning: It can be unsafe to fix this message. Be careful. Especially when there are inner loops. Here is an example where cppcheck will write that the scope for 'i' can be reduced: void f(int x) { int i = 0; if (x) { // it's safe to move 'int i = 0' here for (int n = 0; n < 10; ++n) { // it is possible but not safe to move 'int i = 0' here do_something(&i); } } } When you see this message it is always safe to reduce the variable scope 1 level. [compiz/plugins/decor/src/decor.cpp:581]: (warning) Member variable 'Decoration::refCount' is not initialized in the constructor. [compiz/plugins/decor/src/decor.cpp:1330]: (performance) Checking for 'mList' emptiness might be inefficient. Using mList.empty() instead of mList.size() can be faster. mList.size() can take linear time but mList.empty() is guaranteed to take constant time. [compiz/plugins/decor/src/decor.cpp:838]: (performance) Prefix ++/-- operators should be preferred for non-primitive types. Pre-increment/decrement can be more efficient than post-increment/decrement. Post-increment/decrement usually involves keeping a copy of the previous value around and adds a little extra code. [compiz/plugins/decor/src/decor.cpp:887]: (performance) Prefix ++/-- operators should be preferred for non-primitive types. Pre-increment/decrement can be more efficient than post-increment/decrement. Post-increment/decrement usually involves keeping a copy of the previous value around and adds a little extra code. [compiz/plugins/decor/src/decor.cpp:1343]: (performance) Prefix ++/-- operators should be preferred for non-primitive types. Pre-increment/decrement can be more efficient than post-increment/decrement. Post-increment/decrement usually involves keeping a copy of the previous value around and adds a little extra code. [compiz/plugins/extrawm/src/extrawm.cpp:35]: (performance) Prefix ++/-- operators should be preferred for non-primitive types. Pre-increment/decrement can be more efficient than post-increment/decrement. Post-increment/decrement usually involves keeping a copy of the previous value around and adds a little extra code. [compiz/plugins/extrawm/src/extrawm.cpp:93]: (performance) Prefix ++/-- operators should be preferred for non-primitive types. Pre-increment/decrement can be more efficient than post-increment/decrement. Post-increment/decrement usually involves keeping a copy of the previous value around and adds a little extra code. [compiz/plugins/ezoom/src/ezoom.cpp:1483]: (style) The scope of the variable 'x' can be reduced. Warning: It can be unsafe to fix this message. Be careful. Especially when there are inner loops. Here is an example where cppcheck will write that the scope for 'i' can be reduced: void f(int x) { int i = 0; if (x) { // it's safe to move 'int i = 0' here for (int n = 0; n < 10; ++n) { // it is possible but not safe to move 'int i = 0' here do_something(&i); } } } When you see this message it is always safe to reduce the variable scope 1 level. [compiz/plugins/ezoom/src/ezoom.cpp:1483]: (style) The scope of the variable 'y' can be reduced. Warning: It can be unsafe to fix this message. Be careful. Especially when there are inner loops. Here is an example where cppcheck will write that the scope for 'i' can be reduced: void f(int x) { int i = 0; if (x) { // it's safe to move 'int i = 0' here for (int n = 0; n < 10; ++n) { // it is possible but not safe to move 'int i = 0' here do_something(&i); } } } When you see this message it is always safe to reduce the variable scope 1 level. [compiz/plugins/ezoom/src/ezoom.cpp:1795]: (warning) Member variable 'CursorTexture::screen' is not initialized in the constructor. [compiz/plugins/ezoom/src/ezoom.cpp:1795]: (warning) Member variable 'CursorTexture::width' is not initialized in the constructor. [compiz/plugins/ezoom/src/ezoom.cpp:1795]: (warning) Member variable 'CursorTexture::height' is not initialized in the constructor. [compiz/plugins/ezoom/src/ezoom.cpp:1795]: (warning) Member variable 'CursorTexture::hotX' is not initialized in the constructor. [compiz/plugins/ezoom/src/ezoom.cpp:1795]: (warning) Member variable 'CursorTexture::hotY' is not initialized in the constructor. [compiz/plugins/ezoom/src/ezoom.cpp:213]: (warning) Member variable 'ZoomArea::output' is not initialized in the constructor. [compiz/plugins/firepaint/src/firepaint.cpp:456]: (style) The scope of the variable 'size' can be reduced. Warning: It can be unsafe to fix this message. Be careful. Especially when there are inner loops. Here is an example where cppcheck will write that the scope for 'i' can be reduced: void f(int x) { int i = 0; if (x) { // it's safe to move 'int i = 0' here for (int n = 0; n < 10; ++n) { // it is possible but not safe to move 'int i = 0' here do_something(&i); } } } When you see this message it is always safe to reduce the variable scope 1 level. [compiz/plugins/firepaint/src/firepaint.cpp:52]: (warning) Member variable 'ParticleSystem::x' is not initialized in the constructor. [compiz/plugins/firepaint/src/firepaint.cpp:52]: (warning) Member variable 'ParticleSystem::y' is not initialized in the constructor. [compiz/plugins/firepaint/src/firepaint.cpp:57]: (warning) Member variable 'ParticleSystem::x' is not initialized in the constructor. [compiz/plugins/firepaint/src/firepaint.cpp:57]: (warning) Member variable 'ParticleSystem::y' is not initialized in the constructor. [compiz/plugins/firepaint/src/firepaint.cpp:459]: (performance) Checking for 'points' emptiness might be inefficient. Using points.empty() instead of points.size() can be faster. points.size() can take linear time but points.empty() is guaranteed to take constant time. [compiz/plugins/firepaint/src/firepaint.cpp:483]: (performance) Checking for 'points' emptiness might be inefficient. Using points.empty() instead of points.size() can be faster. points.size() can take linear time but points.empty() is guaranteed to take constant time. [compiz/plugins/grid/src/grid.cpp:635]: (style) The scope of the variable 'check' can be reduced. Warning: It can be unsafe to fix this message. Be careful. Especially when there are inner loops. Here is an example where cppcheck will write that the scope for 'i' can be reduced: void f(int x) { int i = 0; if (x) { // it's safe to move 'int i = 0' here for (int n = 0; n < 10; ++n) { // it is possible but not safe to move 'int i = 0' here do_something(&i); } } } When you see this message it is always safe to reduce the variable scope 1 level. [compiz/plugins/grid/src/grid.h:56]: (warning) Member variable 'GridProps::gravityRight' is not initialized in the constructor. [compiz/plugins/grid/src/grid.h:56]: (warning) Member variable 'GridProps::gravityDown' is not initialized in the constructor. [compiz/plugins/grid/src/grid.h:56]: (warning) Member variable 'GridProps::numCellsX' is not initialized in the constructor. [compiz/plugins/grid/src/grid.h:56]: (warning) Member variable 'GridProps::numCellsY' is not initialized in the constructor. [compiz/plugins/grid/src/grid.cpp:714]: (performance) Checking for 'animations' emptiness might be inefficient. Using animations.empty() instead of animations.size() can be faster. animations.size() can take linear time but animations.empty() is guaranteed to take constant time. [compiz/plugins/grid/src/grid.cpp:450]: (performance) Prefix ++/-- operators should be preferred for non-primitive types. Pre-increment/decrement can be more efficient than post-increment/decrement. Post-increment/decrement usually involves keeping a copy of the previous value around and adds a little extra code. [compiz/plugins/grid/src/grid.cpp:935]: (performance) Prefix ++/-- operators should be preferred for non-primitive types. Pre-increment/decrement can be more efficient than post-increment/decrement. Post-increment/decrement usually involves keeping a copy of the previous value around and adds a little extra code. [compiz/plugins/grid/src/grid.cpp:975]: (performance) Prefix ++/-- operators should be preferred for non-primitive types. Pre-increment/decrement can be more efficient than post-increment/decrement. Post-increment/decrement usually involves keeping a copy of the previous value around and adds a little extra code. [compiz/plugins/group/src/group.cpp:321]: (performance) Prefix ++/-- operators should be preferred for non-primitive types. Pre-increment/decrement can be more efficient than post-increment/decrement. Post-increment/decrement usually involves keeping a copy of the previous value around and adds a little extra code. [compiz/plugins/group/src/init.cpp:121]: (performance) Checking for 'mGroups' emptiness might be inefficient. Using mGroups.empty() instead of mGroups.size() can be faster. mGroups.size() can take linear time but mGroups.empty() is guaranteed to take constant time. [compiz/plugins/group/src/init.cpp:231]: (performance) Checking for 'mGroups' emptiness might be inefficient. Using mGroups.empty() instead of mGroups.size() can be faster. mGroups.size() can take linear time but mGroups.empty() is guaranteed to take constant time. [compiz/plugins/group/src/init.cpp:140]: (error) Uninitialized variable: group [compiz/plugins/group/src/init.cpp:141]: (error) Uninitialized variable: group [compiz/plugins/group/src/init.cpp:188]: (performance) Prefix ++/-- operators should be preferred for non-primitive types. Pre-increment/decrement can be more efficient than post-increment/decrement. Post-increment/decrement usually involves keeping a copy of the previous value around and adds a little extra code. [compiz/plugins/group/src/init.cpp:301]: (performance) Prefix ++/-- operators should be preferred for non-primitive types. Pre-increment/decrement can be more efficient than post-increment/decrement. Post-increment/decrement usually involves keeping a copy of the previous value around and adds a little extra code. [compiz/plugins/group/src/init.cpp:496]: (performance) Prefix ++/-- operators should be preferred for non-primitive types. Pre-increment/decrement can be more efficient than post-increment/decrement. Post-increment/decrement usually involves keeping a copy of the previous value around and adds a little extra code. [compiz/plugins/group/src/init.cpp:505]: (performance) Prefix ++/-- operators should be preferred for non-primitive types. Pre-increment/decrement can be more efficient than post-increment/decrement. Post-increment/decrement usually involves keeping a copy of the previous value around and adds a little extra code. [compiz/plugins/group/src/paint.cpp:591]: (performance) Prefix ++/-- operators should be preferred for non-primitive types. Pre-increment/decrement can be more efficient than post-increment/decrement. Post-increment/decrement usually involves keeping a copy of the previous value around and adds a little extra code. [compiz/plugins/group/src/selection.cpp:123]: (performance) Prefix ++/-- operators should be preferred for non-primitive types. Pre-increment/decrement can be more efficient than post-increment/decrement. Post-increment/decrement usually involves keeping a copy of the previous value around and adds a little extra code. [compiz/plugins/group/src/selection.cpp:130]: (performance) Prefix ++/-- operators should be preferred for non-primitive types. Pre-increment/decrement can be more efficient than post-increment/decrement. Post-increment/decrement usually involves keeping a copy of the previous value around and adds a little extra code. [compiz/plugins/group/src/selection.cpp:189]: (performance) Prefix ++/-- operators should be preferred for non-primitive types. Pre-increment/decrement can be more efficient than post-increment/decrement. Post-increment/decrement usually involves keeping a copy of the previous value around and adds a little extra code. [compiz/plugins/group/src/selection.cpp:320]: (performance) Prefix ++/-- operators should be preferred for non-primitive types. Pre-increment/decrement can be more efficient than post-increment/decrement. Post-increment/decrement usually involves keeping a copy of the previous value around and adds a little extra code. [compiz/plugins/group/src/tab.cpp:2946]: (warning) Member variable 'GroupTabBar::mNextDirection' is not initialized in the constructor. [compiz/plugins/group/src/tab.cpp:986]: (performance) Prefix ++/-- operators should be preferred for non-primitive types. Pre-increment/decrement can be more efficient than post-increment/decrement. Post-increment/decrement usually involves keeping a copy of the previous value around and adds a little extra code. [compiz/plugins/group/src/tab.cpp:1853]: (performance) Prefix ++/-- operators should be preferred for non-primitive types. Pre-increment/decrement can be more efficient than post-increment/decrement. Post-increment/decrement usually involves keeping a copy of the previous value around and adds a little extra code. [compiz/plugins/group/src/tab.cpp:1857]: (performance) Prefix ++/-- operators should be preferred for non-primitive types. Pre-increment/decrement can be more efficient than post-increment/decrement. Post-increment/decrement usually involves keeping a copy of the previous value around and adds a little extra code. [compiz/plugins/loginout/src/loginout.cpp:174]: (style) The scope of the variable 'val2' can be reduced. Warning: It can be unsafe to fix this message. Be careful. Especially when there are inner loops. Here is an example where cppcheck will write that the scope for 'i' can be reduced: void f(int x) { int i = 0; if (x) { // it's safe to move 'int i = 0' here for (int n = 0; n < 10; ++n) { // it is possible but not safe to move 'int i = 0' here do_something(&i); } } } When you see this message it is always safe to reduce the variable scope 1 level. [compiz/plugins/mousepoll/src/mousepoll.cpp:64]: (performance) Prefix ++/-- operators should be preferred for non-primitive types. Pre-increment/decrement can be more efficient than post-increment/decrement. Post-increment/decrement usually involves keeping a copy of the previous value around and adds a little extra code. [compiz/plugins/opacify/src/opacify.cpp:238]: (performance) Checking for 'passive' emptiness might be inefficient. Using passive.empty() instead of passive.size() can be faster. passive.size() can take linear time but passive.empty() is guaranteed to take constant time. [compiz/plugins/opengl/src/fragment.cpp:1053]: (performance) Prefix ++/-- operators should be preferred for non-primitive types. Pre-increment/decrement can be more efficient than post-increment/decrement. Post-increment/decrement usually involves keeping a copy of the previous value around and adds a little extra code. [compiz/plugins/opengl/src/paint.cpp:247]: (performance) Prefix ++/-- operators should be preferred for non-primitive types. Pre-increment/decrement can be more efficient than post-increment/decrement. Post-increment/decrement usually involves keeping a copy of the previous value around and adds a little extra code. [compiz/plugins/opengl/src/screen.cpp:659]: (style) The second of the two statements can never be executed, and so should be removed. [compiz/plugins/place/src/place.cpp:439]: (style) Suspicious expression. Boolean result is used in bitwise operation. The ! operator and the comparison operators have higher precedence than bitwise operators. It is recommended that the expression is clarified with parentheses. [compiz/plugins/place/src/place.cpp:962]: (performance) Prefix ++/-- operators should be preferred for non-primitive types. Pre-increment/decrement can be more efficient than post-increment/decrement. Post-increment/decrement usually involves keeping a copy of the previous value around and adds a little extra code. [compiz/plugins/place/src/screen-size-change/src/screen-size-change.cpp:40]: (style) The scope of the variable 'shiftX' can be reduced. Warning: It can be unsafe to fix this message. Be careful. Especially when there are inner loops. Here is an example where cppcheck will write that the scope for 'i' can be reduced: void f(int x) { int i = 0; if (x) { // it's safe to move 'int i = 0' here for (int n = 0; n < 10; ++n) { // it is possible but not safe to move 'int i = 0' here do_something(&i); } } } When you see this message it is always safe to reduce the variable scope 1 level. [compiz/plugins/place/src/screen-size-change/src/screen-size-change.cpp:40]: (style) The scope of the variable 'shiftY' can be reduced. Warning: It can be unsafe to fix this message. Be careful. Especially when there are inner loops. Here is an example where cppcheck will write that the scope for 'i' can be reduced: void f(int x) { int i = 0; if (x) { // it's safe to move 'int i = 0' here for (int n = 0; n < 10; ++n) { // it is possible but not safe to move 'int i = 0' here do_something(&i); } } } When you see this message it is always safe to reduce the variable scope 1 level. [compiz/plugins/resize/src/resize.cpp:1046]: (style) The scope of the variable 'minWidth' can be reduced. Warning: It can be unsafe to fix this message. Be careful. Especially when there are inner loops. Here is an example where cppcheck will write that the scope for 'i' can be reduced: void f(int x) { int i = 0; if (x) { // it's safe to move 'int i = 0' here for (int n = 0; n < 10; ++n) { // it is possible but not safe to move 'int i = 0' here do_something(&i); } } } When you see this message it is always safe to reduce the variable scope 1 level. [compiz/plugins/resize/src/resize.cpp:1307]: (style) The scope of the variable 'mask' can be reduced. Warning: It can be unsafe to fix this message. Be careful. Especially when there are inner loops. Here is an example where cppcheck will write that the scope for 'i' can be reduced: void f(int x) { int i = 0; if (x) { // it's safe to move 'int i = 0' here for (int n = 0; n < 10; ++n) { // it is possible but not safe to move 'int i = 0' here do_something(&i); } } } When you see this message it is always safe to reduce the variable scope 1 level. [compiz/plugins/ring/src/ring.cpp:454] -> [compiz/plugins/ring/src/ring.cpp:452]: (style) Finding the same code for an if branch and an else branch is suspicious and might indicate a cut and paste or logic error. Please examine this code carefully to determine if it is correct. [compiz/plugins/ring/src/ring.cpp:224]: (style) The scope of the variable 'pixmap' can be reduced. Warning: It can be unsafe to fix this message. Be careful. Especially when there are inner loops. Here is an example where cppcheck will write that the scope for 'i' can be reduced: void f(int x) { int i = 0; if (x) { // it's safe to move 'int i = 0' here for (int n = 0; n < 10; ++n) { // it is possible but not safe to move 'int i = 0' here do_something(&i); } } } When you see this message it is always safe to reduce the variable scope 1 level. [compiz/plugins/ring/src/ring.cpp:1141]: (performance) Checking for 'mWindows' emptiness might be inefficient. Using mWindows.empty() instead of mWindows.size() can be faster. mWindows.size() can take linear time but mWindows.empty() is guaranteed to take constant time. [compiz/plugins/ring/src/ring.cpp:787]: (performance) Prefix ++/-- operators should be preferred for non-primitive types. Pre-increment/decrement can be more efficient than post-increment/decrement. Post-increment/decrement usually involves keeping a copy of the previous value around and adds a little extra code. [compiz/plugins/ring/src/ring.cpp:1119]: (performance) Prefix ++/-- operators should be preferred for non-primitive types. Pre-increment/decrement can be more efficient than post-increment/decrement. Post-increment/decrement usually involves keeping a copy of the previous value around and adds a little extra code. [compiz/plugins/ring/src/ring.cpp:1124]: (performance) Prefix ++/-- operators should be preferred for non-primitive types. Pre-increment/decrement can be more efficient than post-increment/decrement. Post-increment/decrement usually involves keeping a copy of the previous value around and adds a little extra code. [compiz/plugins/ring/src/ring.cpp:1133]: (performance) Prefix ++/-- operators should be preferred for non-primitive types. Pre-increment/decrement can be more efficient than post-increment/decrement. Post-increment/decrement usually involves keeping a copy of the previous value around and adds a little extra code. [compiz/plugins/scale/src/scale.cpp:520]: (performance) Checking for 'slotAreas' emptiness might be inefficient. Using slotAreas.empty() instead of slotAreas.size() can be faster. slotAreas.size() can take linear time but slotAreas.empty() is guaranteed to take constant time. [compiz/plugins/scale/src/scale.cpp:773]: (performance) Prefix ++/-- operators should be preferred for non-primitive types. Pre-increment/decrement can be more efficient than post-increment/decrement. Post-increment/decrement usually involves keeping a copy of the previous value around and adds a little extra code. [compiz/plugins/scale/src/scale.cpp:952]: (performance) Prefix ++/-- operators should be preferred for non-primitive types. Pre-increment/decrement can be more efficient than post-increment/decrement. Post-increment/decrement usually involves keeping a copy of the previous value around and adds a little extra code. [compiz/plugins/screenshot/src/screenshot.cpp:125]: (warning) scanf without field width limits can crash with huge input data. To fix this error message add a field width specifier: %s => %20s %i => %3i Sample program that can crash: #include int main() { int a; scanf("%i", &a); return 0; } To make it crash: perl -e 'print "5"x2100000' | ./a.out [compiz/plugins/screenshot/src/screenshot.cpp:203]: (warning) scanf without field width limits can crash with huge input data. To fix this error message add a field width specifier: %s => %20s %i => %3i Sample program that can crash: #include int main() { int a; scanf("%i", &a); return 0; } To make it crash: perl -e 'print "5"x2100000' | ./a.out [compiz/plugins/session/src/session.cpp:203]: (style) The scope of the variable 'num' can be reduced. Warning: It can be unsafe to fix this message. Be careful. Especially when there are inner loops. Here is an example where cppcheck will write that the scope for 'i' can be reduced: void f(int x) { int i = 0; if (x) { // it's safe to move 'int i = 0' here for (int n = 0; n < 10; ++n) { // it is possible but not safe to move 'int i = 0' here do_something(&i); } } } When you see this message it is always safe to reduce the variable scope 1 level. [compiz/plugins/session/src/session.cpp:270]: (style) The scope of the variable 'x' can be reduced. Warning: It can be unsafe to fix this message. Be careful. Especially when there are inner loops. Here is an example where cppcheck will write that the scope for 'i' can be reduced: void f(int x) { int i = 0; if (x) { // it's safe to move 'int i = 0' here for (int n = 0; n < 10; ++n) { // it is possible but not safe to move 'int i = 0' here do_something(&i); } } } When you see this message it is always safe to reduce the variable scope 1 level. [compiz/plugins/session/src/session.cpp:270]: (style) The scope of the variable 'y' can be reduced. Warning: It can be unsafe to fix this message. Be careful. Especially when there are inner loops. Here is an example where cppcheck will write that the scope for 'i' can be reduced: void f(int x) { int i = 0; if (x) { // it's safe to move 'int i = 0' here for (int n = 0; n < 10; ++n) { // it is possible but not safe to move 'int i = 0' here do_something(&i); } } } When you see this message it is always safe to reduce the variable scope 1 level. [compiz/plugins/session/src/session.cpp:270]: (style) The scope of the variable 'width' can be reduced. Warning: It can be unsafe to fix this message. Be careful. Especially when there are inner loops. Here is an example where cppcheck will write that the scope for 'i' can be reduced: void f(int x) { int i = 0; if (x) { // it's safe to move 'int i = 0' here for (int n = 0; n < 10; ++n) { // it is possible but not safe to move 'int i = 0' here do_something(&i); } } } When you see this message it is always safe to reduce the variable scope 1 level. [compiz/plugins/session/src/session.cpp:270]: (style) The scope of the variable 'height' can be reduced. Warning: It can be unsafe to fix this message. Be careful. Especially when there are inner loops. Here is an example where cppcheck will write that the scope for 'i' can be reduced: void f(int x) { int i = 0; if (x) { // it's safe to move 'int i = 0' here for (int n = 0; n < 10; ++n) { // it is possible but not safe to move 'int i = 0' here do_something(&i); } } } When you see this message it is always safe to reduce the variable scope 1 level. [compiz/plugins/session/src/session.cpp:505]: (performance) Prefix ++/-- operators should be preferred for non-primitive types. Pre-increment/decrement can be more efficient than post-increment/decrement. Post-increment/decrement usually involves keeping a copy of the previous value around and adds a little extra code. [compiz/plugins/shift/src/shift.cpp:1165]: (style) The scope of the variable 'color' can be reduced. Warning: It can be unsafe to fix this message. Be careful. Especially when there are inner loops. Here is an example where cppcheck will write that the scope for 'i' can be reduced: void f(int x) { int i = 0; if (x) { // it's safe to move 'int i = 0' here for (int n = 0; n < 10; ++n) { // it is possible but not safe to move 'int i = 0' here do_something(&i); } } } When you see this message it is always safe to reduce the variable scope 1 level. [compiz/plugins/shift/src/shift.cpp:1455]: (style) The scope of the variable 'i' can be reduced. Warning: It can be unsafe to fix this message. Be careful. Especially when there are inner loops. Here is an example where cppcheck will write that the scope for 'i' can be reduced: void f(int x) { int i = 0; if (x) { // it's safe to move 'int i = 0' here for (int n = 0; n < 10; ++n) { // it is possible but not safe to move 'int i = 0' here do_something(&i); } } } When you see this message it is always safe to reduce the variable scope 1 level. [compiz/plugins/shift/src/shift.cpp:826]: (error) Common realloc mistake: 'mWindows' nulled but not freed upon failure [compiz/plugins/shift/src/shift.cpp:836]: (error) Common realloc mistake: 'mDrawSlots' nulled but not freed upon failure [compiz/plugins/showmouse/src/showmouse.cpp:57]: (warning) Member variable 'ParticleSystem::x' is not initialized in the constructor. [compiz/plugins/showmouse/src/showmouse.cpp:57]: (warning) Member variable 'ParticleSystem::y' is not initialized in the constructor. [compiz/plugins/showmouse/src/showmouse.cpp:62]: (warning) Member variable 'ParticleSystem::x' is not initialized in the constructor. [compiz/plugins/showmouse/src/showmouse.cpp:62]: (warning) Member variable 'ParticleSystem::y' is not initialized in the constructor. [compiz/plugins/snap/src/snap.cpp:204]: (performance) Prefix ++/-- operators should be preferred for non-primitive types. Pre-increment/decrement can be more efficient than post-increment/decrement. Post-increment/decrement usually involves keeping a copy of the previous value around and adds a little extra code. [compiz/plugins/snap/src/snap.cpp:247]: (performance) Prefix ++/-- operators should be preferred for non-primitive types. Pre-increment/decrement can be more efficient than post-increment/decrement. Post-increment/decrement usually involves keeping a copy of the previous value around and adds a little extra code. [compiz/plugins/snap/src/snap.cpp:292]: (performance) Prefix ++/-- operators should be preferred for non-primitive types. Pre-increment/decrement can be more efficient than post-increment/decrement. Post-increment/decrement usually involves keeping a copy of the previous value around and adds a little extra code. [compiz/plugins/snap/src/snap.cpp:333]: (performance) Prefix ++/-- operators should be preferred for non-primitive types. Pre-increment/decrement can be more efficient than post-increment/decrement. Post-increment/decrement usually involves keeping a copy of the previous value around and adds a little extra code. [compiz/plugins/stackswitch/src/stackswitch.cpp:619]: (error) Common realloc mistake: 'mWindows' nulled but not freed upon failure [compiz/plugins/stackswitch/src/stackswitch.cpp:624]: (error) Common realloc mistake: 'mDrawSlots' nulled but not freed upon failure [compiz/plugins/staticswitcher/src/staticswitcher.cpp:1249]: (warning) Member variable 'StaticSwitchScreen::previewWidth' is not initialized in the constructor. [compiz/plugins/staticswitcher/src/staticswitcher.cpp:1249]: (warning) Member variable 'StaticSwitchScreen::previewHeight' is not initialized in the constructor. [compiz/plugins/staticswitcher/src/staticswitcher.cpp:1249]: (warning) Member variable 'StaticSwitchScreen::previewBorder' is not initialized in the constructor. [compiz/plugins/staticswitcher/src/staticswitcher.cpp:1249]: (warning) Member variable 'StaticSwitchScreen::xCount' is not initialized in the constructor. [compiz/plugins/staticswitcher/src/staticswitcher.cpp:556]: (performance) Prefix ++/-- operators should be preferred for non-primitive types. Pre-increment/decrement can be more efficient than post-increment/decrement. Post-increment/decrement usually involves keeping a copy of the previous value around and adds a little extra code. [compiz/plugins/staticswitcher/src/staticswitcher.cpp:561]: (performance) Prefix ++/-- operators should be preferred for non-primitive types. Pre-increment/decrement can be more efficient than post-increment/decrement. Post-increment/decrement usually involves keeping a copy of the previous value around and adds a little extra code. [compiz/plugins/staticswitcher/src/staticswitcher.cpp:565]: (performance) Prefix ++/-- operators should be preferred for non-primitive types. Pre-increment/decrement can be more efficient than post-increment/decrement. Post-increment/decrement usually involves keeping a copy of the previous value around and adds a little extra code. [compiz/plugins/staticswitcher/src/staticswitcher.cpp:569]: (performance) Prefix ++/-- operators should be preferred for non-primitive types. Pre-increment/decrement can be more efficient than post-increment/decrement. Post-increment/decrement usually involves keeping a copy of the previous value around and adds a little extra code. [compiz/plugins/switcher/src/switcher.cpp:483]: (performance) Prefix ++/-- operators should be preferred for non-primitive types. Pre-increment/decrement can be more efficient than post-increment/decrement. Post-increment/decrement usually involves keeping a copy of the previous value around and adds a little extra code. [compiz/plugins/td/src/3d.cpp:393]: (performance) Prefix ++/-- operators should be preferred for non-primitive types. Pre-increment/decrement can be more efficient than post-increment/decrement. Post-increment/decrement usually involves keeping a copy of the previous value around and adds a little extra code. [compiz/plugins/thumbnail/src/thumbnail.cpp:806]: (performance) Checking for 'damageThumbs' emptiness might be inefficient. Using damageThumbs.empty() instead of damageThumbs.size() can be faster. damageThumbs.size() can take linear time but damageThumbs.empty() is guaranteed to take constant time. [compiz/plugins/trailfocus/src/trailfocus.cpp:124]: (performance) Prefix ++/-- operators should be preferred for non-primitive types. Pre-increment/decrement can be more efficient than post-increment/decrement. Post-increment/decrement usually involves keeping a copy of the previous value around and adds a little extra code. [compiz/plugins/trailfocus/src/trailfocus.cpp:155]: (performance) Prefix ++/-- operators should be preferred for non-primitive types. Pre-increment/decrement can be more efficient than post-increment/decrement. Post-increment/decrement usually involves keeping a copy of the previous value around and adds a little extra code. [compiz/plugins/trip/src/trip.cpp:560]: (warning) Member variable 'Ripple::radius' is not initialized in the constructor. [compiz/plugins/trip/src/trip.cpp:560]: (warning) Member variable 'Ripple::rMod' is not initialized in the constructor. [compiz/plugins/trip/src/trip.cpp:560]: (warning) Member variable 'Ripple::duration' is not initialized in the constructor. [compiz/plugins/trip/src/trip.cpp:560]: (warning) Member variable 'Ripple::timer' is not initialized in the constructor. [compiz/plugins/trip/src/trip.cpp:560]: (warning) Member variable 'Ripple::width' is not initialized in the constructor. [compiz/plugins/trip/src/trip.cpp:560]: (warning) Member variable 'Ripple::height' is not initialized in the constructor. [compiz/plugins/trip/src/trip.cpp:560]: (warning) Member variable 'Ripple::adjust' is not initialized in the constructor. [compiz/plugins/wall/src/offset_movement/src/offset-movement.cpp:48]: (performance) Prefix ++/-- operators should be preferred for non-primitive types. Pre-increment/decrement can be more efficient than post-increment/decrement. Post-increment/decrement usually involves keeping a copy of the previous value around and adds a little extra code. [compiz/plugins/wallpaper/src/wallpaper.cpp:373]: (performance) Checking for 'backgroundsPrimary' emptiness might be inefficient. Using backgroundsPrimary.empty() instead of backgroundsPrimary.size() can be faster. backgroundsPrimary.size() can take linear time but backgroundsPrimary.empty() is guaranteed to take constant time. [compiz/plugins/wallpaper/src/wallpaper.cpp:574]: (performance) Checking for 'backgroundsPrimary' emptiness might be inefficient. Using backgroundsPrimary.empty() instead of backgroundsPrimary.size() can be faster. backgroundsPrimary.size() can take linear time but backgroundsPrimary.empty() is guaranteed to take constant time. [compiz/plugins/wobbly/src/wobbly.cpp:37]: (style) The scope of the variable 'v' can be reduced. Warning: It can be unsafe to fix this message. Be careful. Especially when there are inner loops. Here is an example where cppcheck will write that the scope for 'i' can be reduced: void f(int x) { int i = 0; if (x) { // it's safe to move 'int i = 0' here for (int n = 0; n < 10; ++n) { // it is possible but not safe to move 'int i = 0' here do_something(&i); } } } When you see this message it is always safe to reduce the variable scope 1 level. [compiz/plugins/wobbly/src/wobbly.cpp:38]: (style) The scope of the variable 's' can be reduced. Warning: It can be unsafe to fix this message. Be careful. Especially when there are inner loops. Here is an example where cppcheck will write that the scope for 'i' can be reduced: void f(int x) { int i = 0; if (x) { // it's safe to move 'int i = 0' here for (int n = 0; n < 10; ++n) { // it is possible but not safe to move 'int i = 0' here do_something(&i); } } } When you see this message it is always safe to reduce the variable scope 1 level. [compiz/plugins/wobbly/src/wobbly.cpp:39]: (style) The scope of the variable 'e' can be reduced. Warning: It can be unsafe to fix this message. Be careful. Especially when there are inner loops. Here is an example where cppcheck will write that the scope for 'i' can be reduced: void f(int x) { int i = 0; if (x) { // it's safe to move 'int i = 0' here for (int n = 0; n < 10; ++n) { // it is possible but not safe to move 'int i = 0' here do_something(&i); } } } When you see this message it is always safe to reduce the variable scope 1 level. [compiz/plugins/wobbly/src/wobbly.cpp:145]: (style) The scope of the variable 'v' can be reduced. Warning: It can be unsafe to fix this message. Be careful. Especially when there are inner loops. Here is an example where cppcheck will write that the scope for 'i' can be reduced: void f(int x) { int i = 0; if (x) { // it's safe to move 'int i = 0' here for (int n = 0; n < 10; ++n) { // it is possible but not safe to move 'int i = 0' here do_something(&i); } } } When you see this message it is always safe to reduce the variable scope 1 level. [compiz/plugins/wobbly/src/wobbly.cpp:146]: (style) The scope of the variable 's' can be reduced. Warning: It can be unsafe to fix this message. Be careful. Especially when there are inner loops. Here is an example where cppcheck will write that the scope for 'i' can be reduced: void f(int x) { int i = 0; if (x) { // it's safe to move 'int i = 0' here for (int n = 0; n < 10; ++n) { // it is possible but not safe to move 'int i = 0' here do_something(&i); } } } When you see this message it is always safe to reduce the variable scope 1 level. [compiz/plugins/wobbly/src/wobbly.cpp:147]: (style) The scope of the variable 'e' can be reduced. Warning: It can be unsafe to fix this message. Be careful. Especially when there are inner loops. Here is an example where cppcheck will write that the scope for 'i' can be reduced: void f(int x) { int i = 0; if (x) { // it's safe to move 'int i = 0' here for (int n = 0; n < 10; ++n) { // it is possible but not safe to move 'int i = 0' here do_something(&i); } } } When you see this message it is always safe to reduce the variable scope 1 level. [compiz/plugins/wobbly/src/wobbly.cpp:252]: (style) The scope of the variable 'v' can be reduced. Warning: It can be unsafe to fix this message. Be careful. Especially when there are inner loops. Here is an example where cppcheck will write that the scope for 'i' can be reduced: void f(int x) { int i = 0; if (x) { // it's safe to move 'int i = 0' here for (int n = 0; n < 10; ++n) { // it is possible but not safe to move 'int i = 0' here do_something(&i); } } } When you see this message it is always safe to reduce the variable scope 1 level. [compiz/plugins/wobbly/src/wobbly.cpp:253]: (style) The scope of the variable 's' can be reduced. Warning: It can be unsafe to fix this message. Be careful. Especially when there are inner loops. Here is an example where cppcheck will write that the scope for 'i' can be reduced: void f(int x) { int i = 0; if (x) { // it's safe to move 'int i = 0' here for (int n = 0; n < 10; ++n) { // it is possible but not safe to move 'int i = 0' here do_something(&i); } } } When you see this message it is always safe to reduce the variable scope 1 level. [compiz/plugins/wobbly/src/wobbly.cpp:254]: (style) The scope of the variable 'e' can be reduced. Warning: It can be unsafe to fix this message. Be careful. Especially when there are inner loops. Here is an example where cppcheck will write that the scope for 'i' can be reduced: void f(int x) { int i = 0; if (x) { // it's safe to move 'int i = 0' here for (int n = 0; n < 10; ++n) { // it is possible but not safe to move 'int i = 0' here do_something(&i); } } } When you see this message it is always safe to reduce the variable scope 1 level. [compiz/plugins/wobbly/src/wobbly.cpp:359]: (style) The scope of the variable 'v' can be reduced. Warning: It can be unsafe to fix this message. Be careful. Especially when there are inner loops. Here is an example where cppcheck will write that the scope for 'i' can be reduced: void f(int x) { int i = 0; if (x) { // it's safe to move 'int i = 0' here for (int n = 0; n < 10; ++n) { // it is possible but not safe to move 'int i = 0' here do_something(&i); } } } When you see this message it is always safe to reduce the variable scope 1 level. [compiz/plugins/wobbly/src/wobbly.cpp:360]: (style) The scope of the variable 's' can be reduced. Warning: It can be unsafe to fix this message. Be careful. Especially when there are inner loops. Here is an example where cppcheck will write that the scope for 'i' can be reduced: void f(int x) { int i = 0; if (x) { // it's safe to move 'int i = 0' here for (int n = 0; n < 10; ++n) { // it is possible but not safe to move 'int i = 0' here do_something(&i); } } } When you see this message it is always safe to reduce the variable scope 1 level. [compiz/plugins/wobbly/src/wobbly.cpp:361]: (style) The scope of the variable 'e' can be reduced. Warning: It can be unsafe to fix this message. Be careful. Especially when there are inner loops. Here is an example where cppcheck will write that the scope for 'i' can be reduced: void f(int x) { int i = 0; if (x) { // it's safe to move 'int i = 0' here for (int n = 0; n < 10; ++n) { // it is possible but not safe to move 'int i = 0' here do_something(&i); } } } When you see this message it is always safe to reduce the variable scope 1 level. [compiz/plugins/wobbly/src/wobbly.cpp:2144]: (style) The scope of the variable 'i' can be reduced. Warning: It can be unsafe to fix this message. Be careful. Especially when there are inner loops. Here is an example where cppcheck will write that the scope for 'i' can be reduced: void f(int x) { int i = 0; if (x) { // it's safe to move 'int i = 0' here for (int n = 0; n < 10; ++n) { // it is possible but not safe to move 'int i = 0' here do_something(&i); } } } When you see this message it is always safe to reduce the variable scope 1 level. [compiz/plugins/wobbly/src/wobbly.cpp:887]: (warning) Member variable 'Model::springs' is not initialized in the constructor. [compiz/src/action.cpp:292]: (warning) scanf without field width limits can crash with huge input data. To fix this error message add a field width specifier: %s => %20s %i => %3i Sample program that can crash: #include int main() { int a; scanf("%i", &a); return 0; } To make it crash: perl -e 'print "5"x2100000' | ./a.out [compiz/src/event.cpp:2008]: (performance) Prefix ++/-- operators should be preferred for non-primitive types. Pre-increment/decrement can be more efficient than post-increment/decrement. Post-increment/decrement usually involves keeping a copy of the previous value around and adds a little extra code. [compiz/src/match.cpp:394]: (performance) Checking for 'list' emptiness might be inefficient. Using list.empty() instead of list.size() can be faster. list.size() can take linear time but list.empty() is guaranteed to take constant time. [compiz/src/match.cpp:239]: (performance) Prefix ++/-- operators should be preferred for non-primitive types. Pre-increment/decrement can be more efficient than post-increment/decrement. Post-increment/decrement usually involves keeping a copy of the previous value around and adds a little extra code. [compiz/src/match.cpp:240]: (performance) Prefix ++/-- operators should be preferred for non-primitive types. Pre-increment/decrement can be more efficient than post-increment/decrement. Post-increment/decrement usually involves keeping a copy of the previous value around and adds a little extra code. [compiz/src/plugin.cpp:282]: (performance) Prefix ++/-- operators should be preferred for non-primitive types. Pre-increment/decrement can be more efficient than post-increment/decrement. Post-increment/decrement usually involves keeping a copy of the previous value around and adds a little extra code. [compiz/src/plugin.cpp:297]: (performance) Prefix ++/-- operators should be preferred for non-primitive types. Pre-increment/decrement can be more efficient than post-increment/decrement. Post-increment/decrement usually involves keeping a copy of the previous value around and adds a little extra code. [compiz/src/plugin.cpp:334]: (performance) Prefix ++/-- operators should be preferred for non-primitive types. Pre-increment/decrement can be more efficient than post-increment/decrement. Post-increment/decrement usually involves keeping a copy of the previous value around and adds a little extra code. [compiz/src/screen.cpp:2276]: (style) C-style pointer casting [compiz/src/screen.cpp:1154]: (style) The scope of the variable 'icccmVersion' can be reduced. Warning: It can be unsafe to fix this message. Be careful. Especially when there are inner loops. Here is an example where cppcheck will write that the scope for 'i' can be reduced: void f(int x) { int i = 0; if (x) { // it's safe to move 'int i = 0' here for (int n = 0; n < 10; ++n) { // it is possible but not safe to move 'int i = 0' here do_something(&i); } } } When you see this message it is always safe to reduce the variable scope 1 level. [compiz/src/screen.cpp:1091]: (error) BOOST_FOREACH caches the end() iterator. It's undefined behavior if you modify the container. [compiz/src/screen.cpp:2133]: (performance) Checking for 'screenInfo' emptiness might be inefficient. Using screenInfo.empty() instead of screenInfo.size() can be faster. screenInfo.size() can take linear time but screenInfo.empty() is guaranteed to take constant time. [compiz/src/screen.cpp:229]: (performance) Prefix ++/-- operators should be preferred for non-primitive types. Pre-increment/decrement can be more efficient than post-increment/decrement. Post-increment/decrement usually involves keeping a copy of the previous value around and adds a little extra code. [compiz/src/screen.cpp:336]: (performance) Prefix ++/-- operators should be preferred for non-primitive types. Pre-increment/decrement can be more efficient than post-increment/decrement. Post-increment/decrement usually involves keeping a copy of the previous value around and adds a little extra code. [compiz/src/screen.cpp:1029]: (performance) Prefix ++/-- operators should be preferred for non-primitive types. Pre-increment/decrement can be more efficient than post-increment/decrement. Post-increment/decrement usually involves keeping a copy of the previous value around and adds a little extra code. [compiz/src/screen.cpp:2231]: (performance) Prefix ++/-- operators should be preferred for non-primitive types. Pre-increment/decrement can be more efficient than post-increment/decrement. Post-increment/decrement usually involves keeping a copy of the previous value around and adds a little extra code. [compiz/src/screen.cpp:2941]: (performance) Prefix ++/-- operators should be preferred for non-primitive types. Pre-increment/decrement can be more efficient than post-increment/decrement. Post-increment/decrement usually involves keeping a copy of the previous value around and adds a little extra code. [compiz/src/screen.cpp:3005]: (performance) Prefix ++/-- operators should be preferred for non-primitive types. Pre-increment/decrement can be more efficient than post-increment/decrement. Post-increment/decrement usually involves keeping a copy of the previous value around and adds a little extra code. [compiz/src/screen.cpp:3228]: (performance) Prefix ++/-- operators should be preferred for non-primitive types. Pre-increment/decrement can be more efficient than post-increment/decrement. Post-increment/decrement usually involves keeping a copy of the previous value around and adds a little extra code. [compiz/src/screen.cpp:3372]: (performance) Prefix ++/-- operators should be preferred for non-primitive types. Pre-increment/decrement can be more efficient than post-increment/decrement. Post-increment/decrement usually involves keeping a copy of the previous value around and adds a little extra code. [compiz/src/screen.cpp:3407]: (performance) Prefix ++/-- operators should be preferred for non-primitive types. Pre-increment/decrement can be more efficient than post-increment/decrement. Post-increment/decrement usually involves keeping a copy of the previous value around and adds a little extra code. [compiz/src/screen.cpp:3439]: (performance) Prefix ++/-- operators should be preferred for non-primitive types. Pre-increment/decrement can be more efficient than post-increment/decrement. Post-increment/decrement usually involves keeping a copy of the previous value around and adds a little extra code. [compiz/src/screen.cpp:3455]: (performance) Prefix ++/-- operators should be preferred for non-primitive types. Pre-increment/decrement can be more efficient than post-increment/decrement. Post-increment/decrement usually involves keeping a copy of the previous value around and adds a little extra code. [compiz/src/screen.cpp:3513]: (performance) Prefix ++/-- operators should be preferred for non-primitive types. Pre-increment/decrement can be more efficient than post-increment/decrement. Post-increment/decrement usually involves keeping a copy of the previous value around and adds a little extra code. [compiz/src/stackdebugger.cpp:51]: (warning) Member variable 'StackDebugger::mTimeoutRequired' is not initialized in the constructor. [compiz/src/stackdebugger.cpp:84]: (performance) Prefix ++/-- operators should be preferred for non-primitive types. Pre-increment/decrement can be more efficient than post-increment/decrement. Post-increment/decrement usually involves keeping a copy of the previous value around and adds a little extra code. [compiz/src/stackdebugger.cpp:108]: (performance) Prefix ++/-- operators should be preferred for non-primitive types. Pre-increment/decrement can be more efficient than post-increment/decrement. Post-increment/decrement usually involves keeping a copy of the previous value around and adds a little extra code. [compiz/src/stackdebugger.cpp:156]: (performance) Prefix ++/-- operators should be preferred for non-primitive types. Pre-increment/decrement can be more efficient than post-increment/decrement. Post-increment/decrement usually involves keeping a copy of the previous value around and adds a little extra code. [compiz/src/stackdebugger.cpp:252]: (performance) Prefix ++/-- operators should be preferred for non-primitive types. Pre-increment/decrement can be more efficient than post-increment/decrement. Post-increment/decrement usually involves keeping a copy of the previous value around and adds a little extra code. [compiz/src/stackdebugger.cpp:255]: (performance) Prefix ++/-- operators should be preferred for non-primitive types. Pre-increment/decrement can be more efficient than post-increment/decrement. Post-increment/decrement usually involves keeping a copy of the previous value around and adds a little extra code. [compiz/src/stackdebugger.cpp:338]: (performance) Prefix ++/-- operators should be preferred for non-primitive types. Pre-increment/decrement can be more efficient than post-increment/decrement. Post-increment/decrement usually involves keeping a copy of the previous value around and adds a little extra code. [compiz/src/string/tests/printf/src/test-string-printf.cpp:52]: (warning) Member variable 'Value::v' is not initialized in the constructor. [compiz/src/timer/src/timeouthandler.cpp:58]: (performance) Prefix ++/-- operators should be preferred for non-primitive types. Pre-increment/decrement can be more efficient than post-increment/decrement. Post-increment/decrement usually involves keeping a copy of the previous value around and adds a little extra code. [compiz/src/timer/src/timer.cpp:112]: (performance) Prefix ++/-- operators should be preferred for non-primitive types. Pre-increment/decrement can be more efficient than post-increment/decrement. Post-increment/decrement usually involves keeping a copy of the previous value around and adds a little extra code. [compiz/src/timer/src/timer.cpp:155]: (performance) Prefix ++/-- operators should be preferred for non-primitive types. Pre-increment/decrement can be more efficient than post-increment/decrement. Post-increment/decrement usually involves keeping a copy of the previous value around and adds a little extra code. [compiz/src/timer/tests/callbacks/src/test-timer-callbacks.cpp:149]: (performance) Prefix ++/-- operators should be preferred for non-primitive types. Pre-increment/decrement can be more efficient than post-increment/decrement. Post-increment/decrement usually involves keeping a copy of the previous value around and adds a little extra code. [compiz/src/timer/tests/while-calling/src/test-timer-set-times-while-calling.cpp:53]: (performance) Prefix ++/-- operators should be preferred for non-primitive types. Pre-increment/decrement can be more efficient than post-increment/decrement. Post-increment/decrement usually involves keeping a copy of the previous value around and adds a little extra code. [compiz/src/window.cpp:2005]: (error) Analysis failed. If the code is valid then please report this failure.