Skip to content
Commit dd63e5d2 authored by Mårten Kongstad's avatar Mårten Kongstad Committed by Todd Kennedy
Browse files

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
parent c087fbc6
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment