Skip to content

Commit 82c51da

Browse files
yadijsquid-anubis
authored andcommitted
MinGW: Fix error: cannot convert 'const int*' to 'const char*' (#1824)
1 parent 1800e25 commit 82c51da

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/comm/Tcp.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ SetSocketOption(const int fd, const int level, const int optName, const Option &
3030
{
3131
static_assert(std::is_trivially_copyable<Option>::value, "setsockopt() expects POD-like options");
3232
static_assert(!std::is_same<Option, bool>::value, "setsockopt() uses int to represent boolean options");
33-
if (setsockopt(fd, level, optName, &optValue, sizeof(optValue)) < 0) {
33+
if (setsockopt(fd, level, optName, reinterpret_cast<const char *>(&optValue), sizeof(optValue)) < 0) {
3434
const auto xerrno = errno;
3535
debugs(5, DBG_IMPORTANT, "ERROR: setsockopt(2) failure: " << xstrerr(xerrno));
3636
// TODO: Generalize to throw on errors when some callers need that.

0 commit comments

Comments
 (0)