Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

llvm16-libcxx: warns example build #325

Open
kassane opened this issue May 26, 2023 · 3 comments
Open

llvm16-libcxx: warns example build #325

kassane opened this issue May 26, 2023 · 3 comments

Comments

@kassane
Copy link

kassane commented May 26, 2023

Final binary, works:

$> ./http_server_test 
200 
302 
client quit
301 
301 
client quit
200 
200 
302 
client quit
client quit

Building...

$> zig c++ example/main.cpp -I../asio/asio/include -o http_server_test -Ithirdparty/async_simple/ -std=c++20 -Wextra
In file included from example/main.cpp:3:
In file included from example/../include/cinatra.hpp:8:
In file included from example/../include/cinatra/coro_http_client.hpp:16:
example/../include/cinatra/asio_util/asio_coro_util.hpp:53:58: warning: unused parameter 'ec' [-Wunused-parameter]
    timer->async_wait([fn = std::move(func), timer](auto ec) {
                                                         ^
example/../include/cinatra/asio_util/asio_coro_util.hpp:72:42: warning: unused parameter 'executor' [-Wunused-parameter]
    auto coAwait(async_simple::Executor *executor) const noexcept {
                                         ^
In file included from example/main.cpp:3:
In file included from example/../include/cinatra.hpp:8:
In file included from example/../include/cinatra/coro_http_client.hpp:18:
thirdparty/async_simple/async_simple/coro/FutureAwaiter.h:35:37: warning: unused parameter 't' [-Wunused-parameter]
            [continuation](Try<T>&& t) mutable { continuation.resume(); });
                                    ^
In file included from example/main.cpp:3:
In file included from example/../include/cinatra.hpp:8:
In file included from example/../include/cinatra/coro_http_client.hpp:22:
In file included from example/../include/cinatra/uri.hpp:5:
example/../include/cinatra/utils.hpp:445:17: warning: comparison of integers of different signs: 'int' and 'size_type' (aka 'unsigned long') [-Wsign-compare]
  for (i = 0; i < src.length(); i++) {
              ~ ^ ~~~~~~~~~~~~
In file included from example/main.cpp:3:
In file included from example/../include/cinatra.hpp:8:
In file included from example/../include/cinatra/coro_http_client.hpp:24:
example/../include/cinatra/websocket.hpp:191:23: warning: comparison of integers of different signs: 'int' and 'size_type' (aka 'unsigned long') [-Wsign-compare]
    for (int i = 0; i < data.size(); ++i) {
                    ~ ^ ~~~~~~~~~~~
In file included from example/main.cpp:3:
In file included from example/../include/cinatra.hpp:8:
example/../include/cinatra/coro_http_client.hpp:429:70: warning: missing field 'stream' initializer [-Wmissing-field-initializers]
    req_context<std::string> ctx{content_type, "", std::move(content)};
                                                                     ^
example/../include/cinatra/coro_http_client.hpp:435:70: warning: missing field 'stream' initializer [-Wmissing-field-initializers]
    req_context<std::string> ctx{content_type, "", std::move(content)};
                                                                     ^
example/../include/cinatra/coro_http_client.hpp:442:70: warning: missing field 'stream' initializer [-Wmissing-field-initializers]
    req_context<std::string> ctx{content_type, "", std::move(content)};
                                                                     ^
example/../include/cinatra/coro_http_client.hpp:513:34: warning: missing field 'resp_body' initializer [-Wmissing-field-initializers]
      co_return resp_data{{}, 404};
                                 ^
example/../include/cinatra/coro_http_client.hpp:516:69: warning: missing field 'stream' initializer [-Wmissing-field-initializers]
    req_context<std::string> ctx{req_content_type::multipart, "", ""};
                                                                    ^
example/../include/cinatra/coro_http_client.hpp:520:34: warning: missing field 'resp_body' initializer [-Wmissing-field-initializers]
      co_return resp_data{{}, 404};
                                 ^
example/../include/cinatra/coro_http_client.hpp:550:34: warning: missing field 'resp_body' initializer [-Wmissing-field-initializers]
      co_return resp_data{ec, 404};
                                 ^
example/../include/cinatra/coro_http_client.hpp:565:34: warning: missing field 'resp_body' initializer [-Wmissing-field-initializers]
      co_return resp_data{ec, 404};
                                 ^
example/../include/cinatra/coro_http_client.hpp:584:34: warning: missing field 'resp_body' initializer [-Wmissing-field-initializers]
      co_return resp_data{{}, 404};
                                 ^
example/../include/cinatra/coro_http_client.hpp:1106:36: warning: missing field 'resp_body' initializer [-Wmissing-field-initializers]
        co_return resp_data{ec, 404};
                                   ^
example/../include/cinatra/coro_http_client.hpp:1111:38: warning: missing field 'resp_body' initializer [-Wmissing-field-initializers]
          co_return resp_data{ec, 404};
                                     ^
example/../include/cinatra/coro_http_client.hpp:1162:76: warning: missing field 'resp_body' initializer [-Wmissing-field-initializers]
            std::make_error_code(std::errc::no_such_file_or_directory), 404};
                                                                           ^
example/../include/cinatra/coro_http_client.hpp:1168:34: warning: missing field 'resp_body' initializer [-Wmissing-field-initializers]
      co_return resp_data{ec, 404};
                                 ^
example/../include/cinatra/coro_http_client.hpp:1184:38: warning: missing field 'resp_body' initializer [-Wmissing-field-initializers]
          co_return resp_data{ec, 404};
                                     ^
example/../include/cinatra/coro_http_client.hpp:1191:36: warning: missing field 'resp_body' initializer [-Wmissing-field-initializers]
        co_return resp_data{ec, 404};
                                   ^
example/../include/cinatra/coro_http_client.hpp:1196:34: warning: missing field 'resp_body' initializer [-Wmissing-field-initializers]
      co_return resp_data{ec, 404};
                                 ^
example/../include/cinatra/coro_http_client.hpp:1199:32: warning: missing field 'resp_body' initializer [-Wmissing-field-initializers]
    co_return resp_data{{}, 200};
                               ^
In file included from example/main.cpp:3:
In file included from example/../include/cinatra.hpp:9:
In file included from example/../include/cinatra/http_server.hpp:6:
In file included from example/../include/cinatra/connection.hpp:8:
example/../include/cinatra/http_cache.hpp:22:46: warning: comparison of integers of different signs: 'typename iterator_traits<__hash_map_iterator<__hash_iterator<__hash_node<__hash_value_type<string, vector<string>>, void *> *>>>::difference_type' (aka 'long') and 'const size_t' (aka 'const unsigned long') [-Wsign-compare]
    if (std::distance(cur_it_, cache_.end()) > MAX_CACHE_SIZE) {
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~
In file included from example/main.cpp:3:
In file included from example/../include/cinatra.hpp:9:
In file included from example/../include/cinatra/http_server.hpp:6:
In file included from example/../include/cinatra/connection.hpp:9:
In file included from example/../include/cinatra/request.hpp:13:
In file included from example/../include/cinatra/response.hpp:11:
In file included from example/../include/cinatra/session_manager.hpp:8:
example/../include/cinatra/session.hpp:23:22: warning: comparison of integers of different signs: 'std::size_t' (aka 'unsigned long') and 'int' [-Wsign-compare]
    expire_ = expire == -1 ? 86400 : expire;
              ~~~~~~ ^  ~~
example/../include/cinatra/session.hpp:31:32: warning: comparison of integers of different signs: 'std::size_t' (aka 'unsigned long') and 'int' [-Wsign-compare]
    cookie_.set_max_age(expire == -1 ? -1 : time_stamp_);
                        ~~~~~~ ^  ~~
In file included from example/main.cpp:3:
In file included from example/../include/cinatra.hpp:9:
In file included from example/../include/cinatra/http_server.hpp:6:
In file included from example/../include/cinatra/connection.hpp:9:
In file included from example/../include/cinatra/request.hpp:13:
example/../include/cinatra/response.hpp:39:43: warning: unused parameter 'encoding' [-Wunused-parameter]
                         content_encoding encoding = content_encoding::none) {
                                          ^
In file included from example/main.cpp:3:
In file included from example/../include/cinatra.hpp:9:
In file included from example/../include/cinatra/http_server.hpp:6:
In file included from example/../include/cinatra/connection.hpp:9:
In file included from example/../include/cinatra/request.hpp:17:
example/../include/cinatra/url_encode_decode.hpp:55:29: warning: 'codecvt_utf8<wchar_t>' is deprecated [-Wdeprecated-declarations]
  std::wstring_convert<std::codecvt_utf8<wchar_t>> conv;
                            ^
/home/kassane/zig/0.11.0-dev.3301+230ea411f/files/lib/libcxx/include/codecvt:187:28: note: 'codecvt_utf8<wchar_t>' has been explicitly marked deprecated here
class _LIBCPP_TEMPLATE_VIS _LIBCPP_DEPRECATED_IN_CXX17 codecvt_utf8
                           ^
/home/kassane/zig/0.11.0-dev.3301+230ea411f/files/lib/libcxx/include/__config:808:41: note: expanded from macro '_LIBCPP_DEPRECATED_IN_CXX17'
#    define _LIBCPP_DEPRECATED_IN_CXX17 _LIBCPP_DEPRECATED
                                        ^
/home/kassane/zig/0.11.0-dev.3301+230ea411f/files/lib/libcxx/include/__config:781:49: note: expanded from macro '_LIBCPP_DEPRECATED'
#      define _LIBCPP_DEPRECATED __attribute__((deprecated))
                                                ^
In file included from example/main.cpp:3:
In file included from example/../include/cinatra.hpp:9:
In file included from example/../include/cinatra/http_server.hpp:6:
In file included from example/../include/cinatra/connection.hpp:9:
In file included from example/../include/cinatra/request.hpp:17:
example/../include/cinatra/url_encode_decode.hpp:55:8: warning: 'wstring_convert<std::codecvt_utf8<wchar_t>>' is deprecated [-Wdeprecated-declarations]
  std::wstring_convert<std::codecvt_utf8<wchar_t>> conv;
       ^
/home/kassane/zig/0.11.0-dev.3301+230ea411f/files/lib/libcxx/include/locale:3603:28: note: 'wstring_convert<std::codecvt_utf8<wchar_t>>' has been explicitly marked deprecated here
class _LIBCPP_TEMPLATE_VIS _LIBCPP_DEPRECATED_IN_CXX17 wstring_convert
                           ^
/home/kassane/zig/0.11.0-dev.3301+230ea411f/files/lib/libcxx/include/__config:808:41: note: expanded from macro '_LIBCPP_DEPRECATED_IN_CXX17'
#    define _LIBCPP_DEPRECATED_IN_CXX17 _LIBCPP_DEPRECATED
                                        ^
/home/kassane/zig/0.11.0-dev.3301+230ea411f/files/lib/libcxx/include/__config:781:49: note: expanded from macro '_LIBCPP_DEPRECATED'
#      define _LIBCPP_DEPRECATED __attribute__((deprecated))
                                                ^
In file included from example/main.cpp:3:
In file included from example/../include/cinatra.hpp:9:
In file included from example/../include/cinatra/http_server.hpp:6:
In file included from example/../include/cinatra/connection.hpp:9:
In file included from example/../include/cinatra/request.hpp:17:
example/../include/cinatra/url_encode_decode.hpp:60:29: warning: 'codecvt_utf8<wchar_t>' is deprecated [-Wdeprecated-declarations]
  std::wstring_convert<std::codecvt_utf8<wchar_t>> conv;
                            ^
/home/kassane/zig/0.11.0-dev.3301+230ea411f/files/lib/libcxx/include/codecvt:187:28: note: 'codecvt_utf8<wchar_t>' has been explicitly marked deprecated here
class _LIBCPP_TEMPLATE_VIS _LIBCPP_DEPRECATED_IN_CXX17 codecvt_utf8
                           ^
/home/kassane/zig/0.11.0-dev.3301+230ea411f/files/lib/libcxx/include/__config:808:41: note: expanded from macro '_LIBCPP_DEPRECATED_IN_CXX17'
#    define _LIBCPP_DEPRECATED_IN_CXX17 _LIBCPP_DEPRECATED
                                        ^
/home/kassane/zig/0.11.0-dev.3301+230ea411f/files/lib/libcxx/include/__config:781:49: note: expanded from macro '_LIBCPP_DEPRECATED'
#      define _LIBCPP_DEPRECATED __attribute__((deprecated))
                                                ^
In file included from example/main.cpp:3:
In file included from example/../include/cinatra.hpp:9:
In file included from example/../include/cinatra/http_server.hpp:6:
In file included from example/../include/cinatra/connection.hpp:9:
In file included from example/../include/cinatra/request.hpp:17:
example/../include/cinatra/url_encode_decode.hpp:60:8: warning: 'wstring_convert<std::codecvt_utf8<wchar_t>>' is deprecated [-Wdeprecated-declarations]
  std::wstring_convert<std::codecvt_utf8<wchar_t>> conv;
       ^
/home/kassane/zig/0.11.0-dev.3301+230ea411f/files/lib/libcxx/include/locale:3603:28: note: 'wstring_convert<std::codecvt_utf8<wchar_t>>' has been explicitly marked deprecated here
class _LIBCPP_TEMPLATE_VIS _LIBCPP_DEPRECATED_IN_CXX17 wstring_convert
                           ^
/home/kassane/zig/0.11.0-dev.3301+230ea411f/files/lib/libcxx/include/__config:808:41: note: expanded from macro '_LIBCPP_DEPRECATED_IN_CXX17'
#    define _LIBCPP_DEPRECATED_IN_CXX17 _LIBCPP_DEPRECATED
                                        ^
/home/kassane/zig/0.11.0-dev.3301+230ea411f/files/lib/libcxx/include/__config:781:49: note: expanded from macro '_LIBCPP_DEPRECATED'
#      define _LIBCPP_DEPRECATED __attribute__((deprecated))
                                                ^
In file included from example/main.cpp:3:
In file included from example/../include/cinatra.hpp:9:
In file included from example/../include/cinatra/http_server.hpp:6:
In file included from example/../include/cinatra/connection.hpp:9:
example/../include/cinatra/request.hpp:224:3: warning: 'const' type qualifier on return type has no effect [-Wignored-qualifiers]
  const size_t last_len() const { return last_len_; }
  ^~~~~~
In file included from example/main.cpp:3:
In file included from example/../include/cinatra.hpp:9:
In file included from example/../include/cinatra/http_server.hpp:6:
example/../include/cinatra/connection.hpp:55:39: warning: unused parameter 'ssl_conf' [-Wunused-parameter]
  void init_ssl_context(ssl_configure ssl_conf) {
                                      ^
example/../include/cinatra/connection.hpp:715:21: warning: comparison of integers of different signs: 'size_t' (aka 'unsigned long') and 'int' [-Wsign-compare]
      if (part_size == -1) {
          ~~~~~~~~~ ^  ~~
example/../include/cinatra/connection.hpp:447:11: note: in instantiation of member function 'cinatra::connection<cinatra::NonSSL>::handle_string_body' requested here
          handle_string_body(bytes_transferred);
          ^
example/../include/cinatra/connection.hpp:435:7: note: in instantiation of member function 'cinatra::connection<cinatra::NonSSL>::handle_request' requested here
      handle_request(bytes_transferred);
      ^
example/../include/cinatra/connection.hpp:389:11: note: in instantiation of member function 'cinatra::connection<cinatra::NonSSL>::handle_read' requested here
          handle_read(e, bytes_transferred);
          ^
example/../include/cinatra/connection.hpp:339:7: note: in instantiation of member function 'cinatra::connection<cinatra::NonSSL>::async_read_some' requested here
      async_read_some();
      ^
example/../include/cinatra/connection.hpp:277:27: note: in instantiation of member function 'cinatra::connection<cinatra::NonSSL>::do_read' requested here
                          do_read();
                          ^
example/../include/cinatra/http_server.hpp:490:33: note: in instantiation of member function 'cinatra::connection<cinatra::NonSSL>::write_chunked_data' requested here
    req.get_conn<ScoketType>()->write_chunked_data(std::move(str), eof);
                                ^
example/../include/cinatra/http_server.hpp:400:17: note: in instantiation of member function 'cinatra::http_server_<cinatra::NonSSL>::write_chunked_body' requested here
                write_chunked_body(req);
                ^
example/../include/cinatra/http_server.hpp:530:5: note: in instantiation of member function 'cinatra::http_server_<cinatra::NonSSL>::set_static_res_handler' requested here
    set_static_res_handler();
    ^
example/../include/cinatra/http_server.hpp:34:5: note: in instantiation of member function 'cinatra::http_server_<cinatra::NonSSL>::init_conn_callback' requested here
    init_conn_callback();
    ^
example/main.cpp:242:15: note: in instantiation of function template specialization 'cinatra::http_server_<cinatra::NonSSL>::http_server_<unsigned int>' requested here
  http_server server(std::thread::hardware_concurrency());
              ^
33 warnings generated.

Reference .: #297
cc: @qicosmos

@qicosmos
Copy link
Owner

will clean it later.

@qicosmos
Copy link
Owner

could you build with latest code?

@kassane
Copy link
Author

kassane commented Jan 14, 2024

could you build with latest code?

using: zig c++ == clang++ -stdlib=libc++ -fuse-ld=lld

Cmd:

  • clang++ -stdlib=libc++ example/main.cpp -Iinclude -o http_server_test -Ithirdparty/async_simple/ -std=c++20 -Wextra
  • zig c++ example/main.cpp -Iinclude -o http_server_test -Ithirdparty/async_simple/ -std=c++20 -Wextra

Using the same setting in both tools results the same output.

Output
In file included from example/main.cpp:9:
In file included from example/../include/cinatra.hpp:8:
In file included from example/../include/cinatra/coro_http_client.hpp:22:
include/async_simple/coro/FutureAwaiter.h:32:41: warning: unused parameter 't' [-Wunused-parameter]
   32 |                 [continuation](Try<T>&& t) mutable { continuation.resume(); });
      |                                         ^
In file included from example/main.cpp:9:
In file included from example/../include/cinatra.hpp:8:
In file included from example/../include/cinatra/coro_http_client.hpp:25:
In file included from example/../include/cinatra/http_parser.hpp:12:
example/../include/cinatra/url_encode_decode.hpp:103:29: warning: 'codecvt_utf8<wchar_t>' is deprecated [-Wdeprecated-declarations]
  103 |   std::wstring_convert<std::codecvt_utf8<wchar_t>> conv;
      |                             ^
/home/kassane/zig/0.12.0-dev.2158+4f2009de1/files/lib/libcxx/include/codecvt:187:28: note: 'codecvt_utf8<wchar_t>' has been explicitly marked deprecated here
  187 | class _LIBCPP_TEMPLATE_VIS _LIBCPP_DEPRECATED_IN_CXX17 codecvt_utf8
      |                            ^
/home/kassane/zig/0.12.0-dev.2158+4f2009de1/files/lib/libcxx/include/__config:955:41: note: expanded from macro '_LIBCPP_DEPRECATED_IN_CXX17'
  955 | #    define _LIBCPP_DEPRECATED_IN_CXX17 _LIBCPP_DEPRECATED
      |                                         ^
/home/kassane/zig/0.12.0-dev.2158+4f2009de1/files/lib/libcxx/include/__config:928:49: note: expanded from macro '_LIBCPP_DEPRECATED'
  928 | #      define _LIBCPP_DEPRECATED __attribute__((__deprecated__))
      |                                                 ^
In file included from example/main.cpp:9:
In file included from example/../include/cinatra.hpp:8:
In file included from example/../include/cinatra/coro_http_client.hpp:25:
In file included from example/../include/cinatra/http_parser.hpp:12:
example/../include/cinatra/url_encode_decode.hpp:103:8: warning: 'wstring_convert<std::codecvt_utf8<wchar_t>>' is deprecated [-Wdeprecated-declarations]
  103 |   std::wstring_convert<std::codecvt_utf8<wchar_t>> conv;
      |        ^
/home/kassane/zig/0.12.0-dev.2158+4f2009de1/files/lib/libcxx/include/locale:3598:28: note: 'wstring_convert<std::codecvt_utf8<wchar_t>>' has been explicitly marked deprecated here
 3598 | class _LIBCPP_TEMPLATE_VIS _LIBCPP_DEPRECATED_IN_CXX17 wstring_convert
      |                            ^
/home/kassane/zig/0.12.0-dev.2158+4f2009de1/files/lib/libcxx/include/__config:955:41: note: expanded from macro '_LIBCPP_DEPRECATED_IN_CXX17'
  955 | #    define _LIBCPP_DEPRECATED_IN_CXX17 _LIBCPP_DEPRECATED
      |                                         ^
/home/kassane/zig/0.12.0-dev.2158+4f2009de1/files/lib/libcxx/include/__config:928:49: note: expanded from macro '_LIBCPP_DEPRECATED'
  928 | #      define _LIBCPP_DEPRECATED __attribute__((__deprecated__))
      |                                                 ^
In file included from example/main.cpp:9:
In file included from example/../include/cinatra.hpp:8:
In file included from example/../include/cinatra/coro_http_client.hpp:25:
In file included from example/../include/cinatra/http_parser.hpp:12:
example/../include/cinatra/url_encode_decode.hpp:108:29: warning: 'codecvt_utf8<wchar_t>' is deprecated [-Wdeprecated-declarations]
  108 |   std::wstring_convert<std::codecvt_utf8<wchar_t>> conv;
      |                             ^
/home/kassane/zig/0.12.0-dev.2158+4f2009de1/files/lib/libcxx/include/codecvt:187:28: note: 'codecvt_utf8<wchar_t>' has been explicitly marked deprecated here
  187 | class _LIBCPP_TEMPLATE_VIS _LIBCPP_DEPRECATED_IN_CXX17 codecvt_utf8
      |                            ^
/home/kassane/zig/0.12.0-dev.2158+4f2009de1/files/lib/libcxx/include/__config:955:41: note: expanded from macro '_LIBCPP_DEPRECATED_IN_CXX17'
  955 | #    define _LIBCPP_DEPRECATED_IN_CXX17 _LIBCPP_DEPRECATED
      |                                         ^
/home/kassane/zig/0.12.0-dev.2158+4f2009de1/files/lib/libcxx/include/__config:928:49: note: expanded from macro '_LIBCPP_DEPRECATED'
  928 | #      define _LIBCPP_DEPRECATED __attribute__((__deprecated__))
      |                                                 ^
In file included from example/main.cpp:9:
In file included from example/../include/cinatra.hpp:8:
In file included from example/../include/cinatra/coro_http_client.hpp:25:
In file included from example/../include/cinatra/http_parser.hpp:12:
example/../include/cinatra/url_encode_decode.hpp:108:8: warning: 'wstring_convert<std::codecvt_utf8<wchar_t>>' is deprecated [-Wdeprecated-declarations]
  108 |   std::wstring_convert<std::codecvt_utf8<wchar_t>> conv;
      |        ^
/home/kassane/zig/0.12.0-dev.2158+4f2009de1/files/lib/libcxx/include/locale:3598:28: note: 'wstring_convert<std::codecvt_utf8<wchar_t>>' has been explicitly marked deprecated here
 3598 | class _LIBCPP_TEMPLATE_VIS _LIBCPP_DEPRECATED_IN_CXX17 wstring_convert
      |                            ^
/home/kassane/zig/0.12.0-dev.2158+4f2009de1/files/lib/libcxx/include/__config:955:41: note: expanded from macro '_LIBCPP_DEPRECATED_IN_CXX17'
  955 | #    define _LIBCPP_DEPRECATED_IN_CXX17 _LIBCPP_DEPRECATED
      |                                         ^
/home/kassane/zig/0.12.0-dev.2158+4f2009de1/files/lib/libcxx/include/__config:928:49: note: expanded from macro '_LIBCPP_DEPRECATED'
  928 | #      define _LIBCPP_DEPRECATED __attribute__((__deprecated__))
      |                                                 ^
In file included from example/main.cpp:9:
In file included from example/../include/cinatra.hpp:8:
In file included from example/../include/cinatra/coro_http_client.hpp:31:
example/../include/cinatra/websocket.hpp:233:23: warning: comparison of integers of different signs: 'int' and 'size_type' (aka 'unsigned long') [-Wsign-compare]
  233 |     for (int i = 0; i < data.size(); ++i) {
      |                     ~ ^ ~~~~~~~~~~~
In file included from example/main.cpp:9:
In file included from example/../include/cinatra.hpp:8:
In file included from example/../include/cinatra/coro_http_client.hpp:32:
In file included from example/../include/cinatra/ylt/coro_io/coro_file.hpp:26:
example/../include/cinatra/ylt/coro_io/io_context_pool.hpp:93:74: warning: unused parameter 'ec' [-Wunused-parameter]
   93 |     tm->async_wait([fn = std::move(func), timer = std::move(timer)](auto ec) {
      |                                                                          ^
example/../include/cinatra/ylt/coro_io/io_context_pool.hpp:212:23: warning: comparison of integers of different signs: 'int' and 'size_t' (aka 'unsigned long') [-Wsign-compare]
  212 |     for (int i = 0; i < thd_num_; i++) {
      |                     ~ ^ ~~~~~~~~
In file included from example/main.cpp:9:
In file included from example/../include/cinatra.hpp:8:
In file included from example/../include/cinatra/coro_http_client.hpp:32:
In file included from example/../include/cinatra/ylt/coro_io/coro_file.hpp:44:
example/../include/cinatra/ylt/coro_io/coro_io.hpp:40:42: warning: unused parameter 'executor' [-Wunused-parameter]
   40 |     auto coAwait(async_simple::Executor *executor) const noexcept {
      |                                          ^
In file included from example/main.cpp:9:
In file included from example/../include/cinatra.hpp:8:
example/../include/cinatra/coro_http_client.hpp:285:79: warning: missing field 'resp_body' initializer [-Wmissing-field-initializers]
  285 |       co_return resp_data{std::make_error_code(std::errc::protocol_error), 404};
      |                                                                               ^
example/../include/cinatra/coro_http_client.hpp:292:34: warning: missing field 'resp_body' initializer [-Wmissing-field-initializers]
  292 |       co_return resp_data{ec, 404};
      |                                  ^
example/../include/cinatra/coro_http_client.hpp:665:30: warning: missing field 'resp_body' initializer [-Wmissing-field-initializers]
  665 |                           404};
      |                              ^
example/../include/cinatra/coro_http_client.hpp:672:79: warning: missing field 'resp_body' initializer [-Wmissing-field-initializers]
  672 |       co_return resp_data{std::make_error_code(std::errc::protocol_error), 404};
      |                                                                               ^
example/../include/cinatra/coro_http_client.hpp:689:36: warning: missing field 'resp_body' initializer [-Wmissing-field-initializers]
  689 |         co_return resp_data{ec, 404};
      |                                    ^
example/../include/cinatra/coro_http_client.hpp:708:34: warning: missing field 'resp_body' initializer [-Wmissing-field-initializers]
  708 |       co_return resp_data{ec, 404};
      |                                  ^
example/../include/cinatra/coro_http_client.hpp:726:34: warning: missing field 'resp_body' initializer [-Wmissing-field-initializers]
  726 |       co_return resp_data{ec, 404};
      |                                  ^
example/../include/cinatra/coro_http_client.hpp:745:30: warning: missing field 'resp_body' initializer [-Wmissing-field-initializers]
  745 |                           404};
      |                              ^
example/../include/cinatra/coro_http_client.hpp:840:35: warning: missing field 'req_str' initializer [-Wmissing-field-initializers]
  840 |     req_context<> ctx{content_type};
      |                                   ^
example/../include/cinatra/coro_http_client.hpp:844:79: warning: missing field 'resp_body' initializer [-Wmissing-field-initializers]
  844 |       co_return resp_data{std::make_error_code(std::errc::protocol_error), 404};
      |                                                                               ^
example/../include/cinatra/coro_http_client.hpp:851:76: warning: missing field 'resp_body' initializer [-Wmissing-field-initializers]
  851 |             std::make_error_code(std::errc::no_such_file_or_directory), 404};
      |                                                                            ^
example/../include/cinatra/coro_http_client.hpp:858:76: warning: missing field 'resp_body' initializer [-Wmissing-field-initializers]
  858 |             std::make_error_code(std::errc::no_such_file_or_directory), 404};
      |                                                                            ^
example/../include/cinatra/coro_http_client.hpp:880:36: warning: missing field 'resp_body' initializer [-Wmissing-field-initializers]
  880 |         co_return resp_data{ec, 404};
      |                                    ^
example/../include/cinatra/coro_http_client.hpp:890:34: warning: missing field 'resp_body' initializer [-Wmissing-field-initializers]
  890 |       co_return resp_data{ec, 404};
      |                                  ^
example/../include/cinatra/coro_http_client.hpp:914:70: warning: missing field 'resp_body' initializer [-Wmissing-field-initializers]
  914 |             std::make_error_code(std::errc::bad_file_descriptor), 404};
      |                                                                      ^
example/../include/cinatra/coro_http_client.hpp:944:34: warning: missing field 'resp_body' initializer [-Wmissing-field-initializers]
  944 |       co_return resp_data{ec, 404};
      |                                  ^
example/../include/cinatra/coro_http_client.hpp:1653:36: warning: missing field 'resp_body' initializer [-Wmissing-field-initializers]
 1653 |         co_return resp_data{ec, 404};
      |                                    ^
example/../include/cinatra/coro_http_client.hpp:1660:38: warning: missing field 'resp_body' initializer [-Wmissing-field-initializers]
 1660 |           co_return resp_data{ec, 404};
      |                                      ^
example/../include/cinatra/coro_http_client.hpp:1666:38: warning: missing field 'resp_body' initializer [-Wmissing-field-initializers]
 1666 |           co_return resp_data{ec, 404};
      |                                      ^
example/../include/cinatra/coro_http_client.hpp:1722:76: warning: missing field 'resp_body' initializer [-Wmissing-field-initializers]
 1722 |             std::make_error_code(std::errc::no_such_file_or_directory), 404};
      |                                                                            ^
example/../include/cinatra/coro_http_client.hpp:1731:34: warning: missing field 'resp_body' initializer [-Wmissing-field-initializers]
 1731 |       co_return resp_data{ec, 404};
      |                                  ^
example/../include/cinatra/coro_http_client.hpp:1746:38: warning: missing field 'resp_body' initializer [-Wmissing-field-initializers]
 1746 |           co_return resp_data{ec, 404};
      |                                      ^
example/../include/cinatra/coro_http_client.hpp:1750:40: warning: missing field 'resp_body' initializer [-Wmissing-field-initializers]
 1750 |             co_return resp_data{ec, 404};
      |                                        ^
example/../include/cinatra/coro_http_client.hpp:1760:36: warning: missing field 'resp_body' initializer [-Wmissing-field-initializers]
 1760 |         co_return resp_data{ec, 404};
      |                                    ^
example/../include/cinatra/coro_http_client.hpp:1764:32: warning: missing field 'resp_body' initializer [-Wmissing-field-initializers]
 1764 |     co_return resp_data{{}, 200};
      |                                ^
example/../include/cinatra/coro_http_client.hpp:1868:12: warning: unused parameter 'has_init_ssl' [-Wunused-parameter]
 1868 |       bool has_init_ssl = false) noexcept {
      |            ^
example/../include/cinatra/coro_http_client.hpp:1883:44: warning: unused parameter 'has_init_ssl' [-Wunused-parameter]
 1883 |       auto sock, AsioBuffer &&buffer, bool has_init_ssl = false) {
      |                                            ^
In file included from example/main.cpp:9:
In file included from example/../include/cinatra.hpp:9:
In file included from example/../include/cinatra/coro_http_server.hpp:11:
In file included from include/cinatra/coro_http_response.hpp:15:
include/cinatra/time_util.hpp:289:21: warning: comparison of integers of different signs: 'int' and 'size_type' (aka 'unsigned long') [-Wsign-compare]
  289 |   for (int i = 0; i < format.size(); ++i) {
      |                   ~ ^ ~~~~~~~~~~~~~
include/cinatra/time_util.hpp:291:22: warning: comparison of integers of different signs: 'int' and 'size_type' (aka 'unsigned long') [-Wsign-compare]
  291 |       char c = i + 2 < format.size() ? format[i + 2] : '0';
      |                ~~~~~ ^ ~~~~~~~~~~~~~
In file included from example/main.cpp:9:
In file included from example/../include/cinatra.hpp:9:
In file included from example/../include/cinatra/coro_http_server.hpp:12:
In file included from include/cinatra/coro_http_router.hpp:12:
include/cinatra/coro_http_request.hpp:72:29: warning: comparison of integers of different signs: 'int' and 'size_t' (aka 'unsigned long') [-Wsign-compare]
   72 |     if (start > 0 && (start >= file_size || start == end)) {
      |                       ~~~~~ ^  ~~~~~~~~~
include/cinatra/coro_http_request.hpp:78:24: warning: comparison of integers of different signs: 'int' and 'size_t' (aka 'unsigned long') [-Wsign-compare]
   78 |     if (end > 0 && end >= file_size) {
      |                    ~~~ ^  ~~~~~~~~~
In file included from example/main.cpp:9:
In file included from example/../include/cinatra.hpp:9:
In file included from example/../include/cinatra/coro_http_server.hpp:12:
In file included from include/cinatra/coro_http_router.hpp:13:
include/cinatra/coro_radix_tree.hpp:404:14: warning: comparison of integers of different signs: 'size_type' (aka 'unsigned long') and 'int' [-Wsign-compare]
  404 |     return i == -1 ? str.size() : i;
      |            ~ ^  ~~
In file included from example/main.cpp:9:
In file included from example/../include/cinatra.hpp:9:
In file included from example/../include/cinatra/coro_http_server.hpp:12:
include/cinatra/coro_http_router.hpp:32:42: warning: unused parameter 'req' [-Wunused-parameter]
   32 |   virtual bool before(coro_http_request& req, coro_http_response& resp) {
      |                                          ^
include/cinatra/coro_http_router.hpp:32:67: warning: unused parameter 'resp' [-Wunused-parameter]
   32 |   virtual bool before(coro_http_request& req, coro_http_response& resp) {
      |                                                                   ^
include/cinatra/coro_http_router.hpp:36:41: warning: unused parameter 'req' [-Wunused-parameter]
   36 |   virtual bool after(coro_http_request& req, coro_http_response& resp) {
      |                                         ^
include/cinatra/coro_http_router.hpp:36:66: warning: unused parameter 'resp' [-Wunused-parameter]
   36 |   virtual bool after(coro_http_request& req, coro_http_response& resp) {
      |                                                                  ^
In file included from example/main.cpp:9:
In file included from example/../include/cinatra.hpp:9:
In file included from example/../include/cinatra/coro_http_server.hpp:15:
example/../include/cinatra/coro_http_connection.hpp:471:31: warning: missing field 'type' initializer [-Wmissing-field-initializers]
  471 |     websocket_result result{ec};
      |                               ^
In file included from example/main.cpp:9:
In file included from example/../include/cinatra.hpp:9:
example/../include/cinatra/coro_http_server.hpp:366:37: warning: comparison of integers of different signs: 'int' and 'size_type' (aka 'unsigned long') [-Wsign-compare]
  366 |                   for (int i = 0; i < ranges.size(); i++) {
      |                                   ~ ^ ~~~~~~~~~~~~~
example/../include/cinatra/coro_http_server.hpp:378:27: warning: comparison of integers of different signs: 'int' and 'size_type' (aka 'unsigned long') [-Wsign-compare]
  378 |                     if (i == ranges.size() - 1) {
      |                         ~ ^  ~~~~~~~~~~~~~~~~~
example/main.cpp:248:59: warning: unused parameter 'res' [-Wunused-parameter]
  248 |   bool before(coro_http_request &req, coro_http_response &res) {
      |                                                           ^
example/main.cpp:286:37: warning: unused parameter 'req' [-Wunused-parameter]
  286 |       "/get", [](coro_http_request &req, coro_http_response &resp) {
      |                                     ^
In file included from example/main.cpp:9:
In file included from example/../include/cinatra.hpp:9:
In file included from example/../include/cinatra/coro_http_server.hpp:11:
In file included from include/cinatra/coro_http_response.hpp:15:
include/cinatra/time_util.hpp:266:21: warning: comparison of integers of different signs: 'int' and 'unsigned long' [-Wsign-compare]
  266 |   for (int i = 0; i < N; i++) {
      |                   ~ ^ ~
include/cinatra/time_util.hpp:274:52: note: in instantiation of function template specialization 'cinatra::to_int<4UL>' requested here
  274 | inline void to_year(char *buf, int year, char c) { to_int<4>(year, c, buf); }
      |                                                    ^
include/cinatra/time_util.hpp:266:21: warning: comparison of integers of different signs: 'int' and 'unsigned long' [-Wsign-compare]
  266 |   for (int i = 0; i < N; i++) {
      |                   ~ ^ ~
include/cinatra/time_util.hpp:275:54: note: in instantiation of function template specialization 'cinatra::to_int<2UL>' requested here
  275 | inline void to_month(char *buf, int month, char c) { to_int<2>(month, c, buf); }
      |                                                      ^
include/cinatra/time_util.hpp:289:21: warning: comparison of integers of different signs: 'int' and 'size_type' (aka 'unsigned long') [-Wsign-compare]
  289 |   for (int i = 0; i < format.size(); ++i) {
      |                   ~ ^ ~~~~~~~~~~~~~
include/cinatra/time_util.hpp:358:14: note: in instantiation of function template specialization 'cinatra::get_local_time_str<8UL, 32UL>' requested here
  358 |   auto str = get_local_time_str(buf, tm, "%Y-%m-%d %H:%M:%S");
      |              ^
include/cinatra/time_util.hpp:291:22: warning: comparison of integers of different signs: 'int' and 'size_type' (aka 'unsigned long') [-Wsign-compare]
  291 |       char c = i + 2 < format.size() ? format[i + 2] : '0';
      |                ~~~~~ ^ ~~~~~~~~~~~~~
include/cinatra/time_util.hpp:289:21: warning: comparison of integers of different signs: 'int' and 'size_type' (aka 'unsigned long') [-Wsign-compare]
  289 |   for (int i = 0; i < format.size(); ++i) {
      |                   ~ ^ ~~~~~~~~~~~~~
include/cinatra/time_util.hpp:380:12: note: in instantiation of function template specialization 'cinatra::get_local_time_str<0UL, 32UL>' requested here
  380 |   auto s = get_local_time_str<0>(buf, t, "%a, %d %b %Y %H:%M:%S");
      |            ^
include/cinatra/time_util.hpp:401:14: note: in instantiation of function template specialization 'cinatra::get_gmt_time_str<32UL>' requested here
  401 |   auto str = get_gmt_time_str(buf, tm);
      |              ^
include/cinatra/time_util.hpp:291:22: warning: comparison of integers of different signs: 'int' and 'size_type' (aka 'unsigned long') [-Wsign-compare]
  291 |       char c = i + 2 < format.size() ? format[i + 2] : '0';
      |                ~~~~~ ^ ~~~~~~~~~~~~~
In file included from example/main.cpp:9:
In file included from example/../include/cinatra.hpp:8:
example/../include/cinatra/coro_http_client.hpp:840:35: warning: missing field 'req_str' initializer [-Wmissing-field-initializers]
  840 |     req_context<> ctx{content_type};
      |                                   ^
example/main.cpp:79:33: note: in instantiation of function template specialization 'cinatra::coro_http_client::async_upload_chunked<std::string_view, (lambda at example/main.cpp:74:13)>' requested here
   79 |   auto result = co_await client.async_upload_chunked(
      |                                 ^
In file included from example/main.cpp:9:
In file included from example/../include/cinatra.hpp:8:
example/../include/cinatra/coro_http_client.hpp:844:79: warning: missing field 'resp_body' initializer [-Wmissing-field-initializers]
  844 |       co_return resp_data{std::make_error_code(std::errc::protocol_error), 404};
      |                                                                               ^
example/../include/cinatra/coro_http_client.hpp:880:36: warning: missing field 'resp_body' initializer [-Wmissing-field-initializers]
  880 |         co_return resp_data{ec, 404};
      |                                    ^
example/../include/cinatra/coro_http_client.hpp:890:34: warning: missing field 'resp_body' initializer [-Wmissing-field-initializers]
  890 |       co_return resp_data{ec, 404};
      |                                  ^
example/../include/cinatra/coro_http_client.hpp:944:34: warning: missing field 'resp_body' initializer [-Wmissing-field-initializers]
  944 |       co_return resp_data{ec, 404};
      |                                  ^
example/../include/cinatra/coro_http_client.hpp:840:35: warning: missing field 'req_str' initializer [-Wmissing-field-initializers]
  840 |     req_context<> ctx{content_type};
      |                                   ^
example/main.cpp:143:33: note: in instantiation of function template specialization 'cinatra::coro_http_client::async_upload_chunked<std::string_view, std::shared_ptr<std::stringstream>>' requested here
  143 |   auto result = co_await client.async_upload_chunked(
      |                                 ^
In file included from example/main.cpp:9:
In file included from example/../include/cinatra.hpp:8:
example/../include/cinatra/coro_http_client.hpp:844:79: warning: missing field 'resp_body' initializer [-Wmissing-field-initializers]
  844 |       co_return resp_data{std::make_error_code(std::errc::protocol_error), 404};
      |                                                                               ^
example/../include/cinatra/coro_http_client.hpp:851:76: warning: missing field 'resp_body' initializer [-Wmissing-field-initializers]
  851 |             std::make_error_code(std::errc::no_such_file_or_directory), 404};
      |                                                                            ^
example/../include/cinatra/coro_http_client.hpp:880:36: warning: missing field 'resp_body' initializer [-Wmissing-field-initializers]
  880 |         co_return resp_data{ec, 404};
      |                                    ^
example/../include/cinatra/coro_http_client.hpp:890:34: warning: missing field 'resp_body' initializer [-Wmissing-field-initializers]
  890 |       co_return resp_data{ec, 404};
      |                                  ^
example/../include/cinatra/coro_http_client.hpp:944:34: warning: missing field 'resp_body' initializer [-Wmissing-field-initializers]
  944 |       co_return resp_data{ec, 404};
      |                                  ^
67 warnings generated.

clang_output.log
zigcpp_output.log

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants