Skip to content

advice: update cmake and some compiler advice #2516

@bethebest0622

Description

@bethebest0622

could you update cmake_minium_requirements to 4.x?

and following is some complier advice of code:

/root/http_util/third_party/drogon/lib/src/HttpUtils.cc:62:10: warning: ‘drogon::CT_APPLICATION_X_JAVASCRIPT’ is deprecated: use CT_TEXT_JAVASCRIPT [-Wdeprecated-declarations]
   62 |         {CT_APPLICATION_X_JAVASCRIPT,
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /root/http_util/third_party/drogon/lib/src/HttpUtils.h:18,
                 from /root/http_util/third_party/drogon/lib/src/HttpUtils.cc:15:
/root/http_util/third_party/drogon/lib/inc/drogon/HttpTypes.h:106:5: note: declared here
  106 |     CT_APPLICATION_X_JAVASCRIPT [[deprecated("use CT_TEXT_JAVASCRIPT")]],
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~
/root/http_util/third_party/drogon/lib/src/HttpUtils.cc: In lambda function:
/root/http_util/third_party/drogon/lib/src/HttpUtils.cc:733:23: warning: ‘drogon::CT_APPLICATION_X_JAVASCRIPT’ is deprecated: use CT_TEXT_JAVASCRIPT [-Wdeprecated-declarations]
  733 |         extensionMap_[CT_APPLICATION_X_JAVASCRIPT] =
      |                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~
/root/http_util/third_party/drogon/lib/inc/drogon/HttpTypes.h:106:5: note: declared here
  106 |     CT_APPLICATION_X_JAVASCRIPT [[deprecated("use CT_TEXT_JAVASCRIPT")]],
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~
/root/http_util/third_party/drogon/lib/src/HttpServer.cc: In static member function ‘static void drogon::HttpServer::onMessage(const trantor::TcpConnectionPtr&, trantor::MsgBuffer*)’:
/root/http_util/third_party/drogon/lib/src/HttpServer.cc:223:44: warning: suggest parentheses around ‘&&’ within ‘||’ [-Wparentheses]
  223 |         if (parseRes >= 2 || parseRes == 1 && !req->isStreamMode())
      |                              ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~

/root/http_util/third_party/drogon/examples/cors/main.cc: In lambda function:
/root/http_util/third_party/drogon/examples/cors/main.cc:50:29: warning: moving a local object in a return statement prevents copy elision [-Wpessimizing-move]
   50 |             return std::move(resp);
      |                    ~~~~~~~~~^~~~~~
/root/http_util/third_party/drogon/examples/cors/main.cc:50:29: note: remove ‘std::move’ call
/root/http_util/third_party/drogon/examples/async_stream/RequestStreamExampleCtrl.cc: In lambda function:
/root/http_util/third_party/drogon/examples/async_stream/RequestStreamExampleCtrl.cc:89:33: warning: missing initializer for member ‘RequestStreamExampleCtrl::stream_upload(const drogon::HttpRequestPtr&, drogon::RequestStreamPtr&&, std::function<void(const std::shared_ptr<drogon::HttpResponse>&)>&&) const::Entry::tmpName’ [-Wmissing-field-initializers]
   89 |                 files->push_back({std::move(header)});
      |                 ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~
/root/http_util/third_party/drogon/examples/async_stream/RequestStreamExampleCtrl.cc:89:33: warning: missing initializer for member ‘RequestStreamExampleCtrl::stream_upload(const drogon::HttpRequestPtr&, drogon::RequestStreamPtr&&, std::function<void(const std::shared_ptr<drogon::HttpResponse>&)>&&) const::Entry::file’ [-Wmissing-field-initializers]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions