Skip to content

Commit

Permalink
Better way to suppress -Wint-to-pointer-cast
Browse files Browse the repository at this point in the history
  • Loading branch information
rui314 committed Jan 3, 2022
1 parent 7bb478b commit 8590fd9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ std::string_view errno_string() {
// always write an error message to a given buffer.

if (std::is_same<decltype(strerror_r(errno, buf, sizeof(buf))), char *>::value)
return (char *)(uintptr_t)strerror_r(errno, buf, sizeof(buf));
return reinterpret_cast<char *>(strerror_r(errno, buf, sizeof(buf)));
strerror_r(errno, buf, sizeof(buf));
return buf;
}
Expand Down

0 comments on commit 8590fd9

Please sign in to comment.