ethereum-mining / ethminer

Ethereum miner with OpenCL, CUDA and stratum support
GNU General Public License v3.0
5.96k stars 2.28k forks source link

Boost build warning #1266

Closed XhmikosR closed 6 years ago

XhmikosR commented 6 years ago

So we are getting this warning:

C:\projects\ethminer\libpoolprotocols\stratum\EthStratumClient.cpp(177): warning C4996: 'boost::asio::basic_socket<Protocol>::cancel': By default, this function always fails with operation_not_supported when used on Windows XP, Windows Server 2003, or earlier. Consult documentation for details. [C:\projects\ethminer\build\libpoolprotocols\poolprotocols.vcxproj]

@AndreaLanfranchi: do we need to define something ourselves/change the code? I mean, < Vista isn't supported by the Windows binaries at all.

AndreaLanfranchi commented 6 years ago

I did not notice it as I don't have Vista. Can you provide the error code ?

XhmikosR commented 6 years ago

@AndreaLanfranchi this is a build warning, not a runtime warning. I obviously don't have Vista either, no sane person has :P

AndreaLanfranchi commented 6 years ago

It would be interesting to know why it should fail on such OSes

XhmikosR commented 6 years ago

You could try checking Boost's own documentation.

AndreaLanfranchi commented 6 years ago

Checked ... might be related to the missing definition of BOOST_ASIO_ENABLE_CANCELIO. Problem is this definition apparently MUST be included in all source files and, anyway, it does not guarantee to cancel properly pending IO until the socket is closed.

My suggestion is to trap error and continue ... few lines after socket is closed.

XhmikosR commented 6 years ago

Maybe a combination of the 2 solutions you describe would be the best approach?