-
- Downloads
idmap2: assign uninitialized variables initial values
In C++, local primitives are not automatically initialized: void foo() { int i; // primitive: value is indeterminate std::string s; // class: calls default ctor ... } Create.cpp and Dump.cpp include this type of uninitialized variable; fix this by explicitly assigning an initial value. Also add a new script to help catch these types of errors in the future: valgrind.sh, which will run a few idmap2 commands and the idmap2_tests through Valgrind. Also update static-checks.sh to rely on a command's return value instead of the presence of any output. Test: frameworks/base/cmds/idmap2/valgrind.sh Change-Id: Ic9dbd3e9a768beb39ac677ff294b0fca5ee8f9d2
Showing
- cmds/idmap2/idmap2/Create.cpp 1 addition, 1 deletioncmds/idmap2/idmap2/Create.cpp
- cmds/idmap2/idmap2/Dump.cpp 1 addition, 1 deletioncmds/idmap2/idmap2/Dump.cpp
- cmds/idmap2/static-checks.sh 3 additions, 2 deletionscmds/idmap2/static-checks.sh
- cmds/idmap2/valgrind.sh 59 additions, 0 deletionscmds/idmap2/valgrind.sh
Loading
Please register or sign in to comment