beast
beast copied to clipboard
MSVC warning about unused variable
I'm getting a warning from MSVC about unreferenced formal parameter in boost 1.75.0 here:
https://github.com/boostorg/beast/blob/855fc23885307aeb6ad1318001a4bbdd4345d47c/include/boost/beast/websocket/impl/ssl.hpp#L65
Great, thanks for letting me know.
Was not able to reproduce this warning with the following setup and using /Wall on boost 1.75.0 (x64):
Visual Studio 16 2019 Windows SDK version 10.0.18362.0 to target Windows 10.0.19042 MSVC 19.28.29335.0
@oxygene could you provide further information about your setup?
That's interesting, as /Wall is supposed to Displays all warnings displayed by /W4 and all other warnings that /W4 doesn't include—for example, warnings that are off by default. as per documentation.
We are using MSVC2017 with default /W3 warning level, but selectively pull in other warnings like /w34100 (https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-4-c4100) which is the one I mentioned in this issue.
The code line mentioned in my first post undoubtedly declares bytes_transferred but does not use it anywhere. Unfortunately, I don't understand the code base good enough to tell whether the second parameter is needed to satisfy some concept or interface, but I've seen boost::ignore_unused(bytes_transferred) being used in other places and maybe this is the solution here as well?
just leave out the parameter name if it is unused
Closing this as the fix seems to be merged.