drogon icon indicating copy to clipboard operation
drogon copied to clipboard

simple_reverse_proxy build error

Open nobody93 opened this issue 1 year ago • 3 comments

I added simple_reverse_proxy to CMakeLists.txt, but it got following building error:

drogon/examples/simple_reverse_proxy/plugins/SimpleReverseProxy.cc:42:60: error: unused parameter ‘ioLoopIndex’ [-Werror=unused-parameter] 42 | [this](std::vector<HttpClientPtr> &clients, size_t ioLoopIndex) { |

Branch: master Build host: ubuntu 20.04

What could I be missing?

thank you

nobody93 avatar Nov 10 '23 05:11 nobody93

Unfortunately I don’t have the time to investigate this issue further, but it looks like some recent changes were introduced that make the compiler more aggressive as I get similar errors about unused values on macOS Monterey with Trantor:

/tmp/drogon-20231110-7398-qzdq7n/trantor/trantor/utils/Logger.cc:396:5: error: expression result unused [-Werror,-Wunused-value]
    (bool)logger;
    ^     ~~~~~~
1 error generated.

rbugajewski avatar Nov 10 '23 06:11 rbugajewski

PR #1839 may be the culprit.

rbugajewski avatar Nov 10 '23 07:11 rbugajewski

Fixed it. @An Tao, I presume you did not intend to assign the ioLoopIndex in that lambda call, remove the ioLoopIndex fixed the build. In general for similar errors, if a variable is not used, to remove it should fix the build. Thank you

nobody93 avatar Nov 10 '23 09:11 nobody93