Skip to content
This repository has been archived by the owner on Jul 11, 2023. It is now read-only.

Uninitialized local variable returned from Node::GetAttribute<> #53

Open
GoogleCodeExporter opened this issue Mar 17, 2015 · 0 comments

Comments

@GoogleCodeExporter
Copy link

What steps will reproduce the problem?

When Node::GetAttribute is called with any POD type for a node which
doesn't contain the attribute specified, the value returned is undefined.
It causes a debug break in VS: "Variable used without being initialized".

E.g.:
bool res = node->GetAttribute<bool>("something", false);

To fix it, replace:
T value;

with
T value = T();

Original issue reported on code.google.com by [email protected] on 24 Jul 2009 at 6:26

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant