Skip to content

[C++] Update the version of GoogleTest in cpp/thirdparty/versions.txt to 1.17 to prevent potential undefined behavior in ASSERT_DOUBLE_EQ and ASSERT_FLOAT_EQ #48376

@andishgar

Description

@andishgar

Describe the bug, including details regarding any error messages, version, and platform.

As mentioned here, Arrow CMake currently uses version 1.16 of GoogleTest. However, as noted in this commit, prior to version 1.17, GoogleTest used union-based type punning, which is considered undefined behavior in C++ (see cppreference):

It is undefined behavior to read from the member of a union that wasn't most recently written.

Therefore, the version of GoogleTest used by Arrow should be updated to 1.17 to avoid this UB.

Component(s)

C++

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions