Skip to content

Compile error #151

@paulshapiro

Description

@paulshapiro

Hey there,

Thought I'd mention that develop has a compile error that seems to be unintentional - where const memory of epee::byte_slice::data() is being asked to be used to initialize a mutable (non-const) object

#15 3.653 /monero-lws/src/rpc/scanner/connection.cpp: In member function 'boost::asio::mutable_buffer lws::rpc::scanner::connection::read_buffer(std::size_t)':
#15 3.653 /monero-lws/src/rpc/scanner/connection.cpp:58:54: warning: invalid conversion from 'const void*' to 'void*' [-fpermissive]
#15 3.653    58 |     return boost::asio::mutable_buffer(read_buf_.data(), size);
#15 3.653       |                                        ~~~~~~~~~~~~~~^~
#15 3.653       |                                                      |
#15 3.653       |                                                      const void*
#15 3.653 In file included from /monero-lws/src/rpc/scanner/connection.h:30,
#15 3.653                  from /monero-lws/src/rpc/scanner/connection.cpp:28:
#15 3.653 /usr/include/boost/asio/buffer.hpp:102:24: note:   initializing argument 1 of 'boost::asio::mutable_buffer::mutable_buffer(void*, std::size_t)'
#15 3.653   102 |   mutable_buffer(void* data, std::size_t size) BOOST_ASIO_NOEXCEPT
#15 3.653       |                  ~~~~~~^~~~

return boost::asio::mutable_buffer(read_buf_.data(), size);

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