Skip to content

Commit

Permalink
fix #7143: type punning in test
Browse files Browse the repository at this point in the history
  • Loading branch information
nunoplopes committed Mar 4, 2024
1 parent 91886da commit 57c20be
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/test/hwf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,9 @@ static void bug_to_rational() {

static void bug_is_int() {
unsigned raw_val[2] = { 2147483648u, 1077720461u };
double val = *(double*)(raw_val);
double val;
static_assert(sizeof(raw_val) == sizeof(val));
memcpy(&val, raw_val, sizeof(val));
std::cout << val << "\n";
hwf_manager m;
hwf a;
Expand Down

0 comments on commit 57c20be

Please sign in to comment.