Skip to content

reactphysics3d::TriangleVertexArray::getVertex doesn't return a value in all control paths #437

Description

@EntityPlantt
reactphysics3d/src/collision/TriangleVertexArray.cpp: In member function ‘reactphysics3d::Vector3 reactphysics3d::TriangleVertexArray::getVertex(reactphysics3d::uint32) const’:
reactphysics3d/src/collision/TriangleVertexArray.cpp:163:1: warning: control reaches end of non-void function [-Wreturn-type]
  163 | }
      | ^

This is the only warning I got during compilation, and may be an error point in many applications.

Looking at the code, there's a single assert(false) instead of a return, but add something like a throw after it so the compiler doesn't give this warning.

return Vector3(decimal(vertices[0]), decimal(vertices[1]), decimal(vertices[2]));
}
else {
assert(false);
}
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions