diff --git a/tests.cpp b/tests.cpp index b5b98652f..1e1a2a946 100644 --- a/tests.cpp +++ b/tests.cpp @@ -29,6 +29,7 @@ static void operator_eq(); static void memleak_in_function(); static void memleak_in_class(); static void division(); +static void unused_variable(); //--------------------------------------------------------------------------- int main() @@ -60,6 +61,9 @@ int main() // Check for dangerous division.. such as "svar / uvar". Treating "svar" as unsigned data is not good division(); + // unused variable.. + unused_variable(); + std::cout << "Success Rate: " << SuccessCount << " / " @@ -693,3 +697,22 @@ static void division() } //--------------------------------------------------------------------------- + +static void unused_variable() +{ + // Unused private member variable... + const char test1[] = "class Fred\n" + "{\n" + "private:\n" + " int i;\n" + "public:\n" + " Fred();\n" + "};\n" + "Fred::Fred()\n" + "{\n" + " i = 0;\n" + "}\n"; + + +} + diff --git a/todo.txt b/todo.txt new file mode 100644 index 000000000..f09fd8b18 --- /dev/null +++ b/todo.txt @@ -0,0 +1,31 @@ + + +Userdefined types + + I think this needs to be handled better. + + + + +Unused function / variable + + If the user provides "--recursive" there should be + warnings for unused functions and variables. + + Check if all members in the public section of a class + are used externally. + + + + +Dead pointers + + Check for dead pointers + + + +Buffer overruns + + When writing to struct members + +