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

Cant't compile libkiwix - fails on test #632

Closed
juuz0 opened this issue Nov 8, 2021 · 3 comments
Closed

Cant't compile libkiwix - fails on test #632

juuz0 opened this issue Nov 8, 2021 · 3 comments
Assignees
Labels
Milestone

Comments

@juuz0
Copy link
Collaborator

juuz0 commented Nov 8, 2021

Hi there , libkiwix compilation is failing for me (latest master) :(

Environment : Ubuntu 21.10, GCC 11.2.0

I can get around with doing werror=false but maybe that shouldn't be done :>

[86/88] Compiling C++ object test/server.p/server.cpp.o
FAILED: test/server.p/server.cpp.o 
c++ -Itest/server.p -I/usr/local/include -I/usr/include/x86_64-linux-gnu -I/usr/include/p11-kit-1 -fdiagnostics-color=always -pipe -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wnon-virtual-dtor -Werror -std=c++11 -g -pthread -isystem../subprojects/googletest-release-1.8.1/googletest -isystemsubprojects/googletest-release-1.8.1/googletest -isystem../subprojects/googletest-release-1.8.1/googletest/include -MD -MQ test/server.p/server.cpp.o -MF test/server.p/server.cpp.o.d -o test/server.p/server.cpp.o -c ../test/server.cpp
In file included from ../test/server.cpp:2:
../test/./httplib.h: In member function ‘ssize_t httplib::Stream::write_format(const char*, const Args& ...) [with Args = {const char*, const char*}]’:
../test/./httplib.h:2897:42: error: ‘buf’ may be used uninitialized [-Werror=maybe-uninitialized]
 2897 |   auto sn = snprintf(buf.data(), buf.size() - 1, fmt, args...);
      |                                  ~~~~~~~~^~
In file included from ../test/./httplib.h:134,
                 from ../test/server.cpp:2:
/usr/include/c++/11/array:176:7: note: by argument 1 of type ‘const std::array<char, 2048>*’ to ‘constexpr std::array<_Tp, _Nm>::size_type std::array<_Tp, _Nm>::size() const [with _Tp = char; long unsigned int _Nm = 2048]’ declared here
  176 |       size() const noexcept { return _Nm; }
      |       ^~~~
In file included from ../test/server.cpp:2:
../test/./httplib.h:2892:26: note: ‘buf’ declared here
 2892 |   std::array<char, 2048> buf;
      |                          ^~~
../test/./httplib.h: In member function ‘ssize_t httplib::Stream::write_format(const char*, const Args& ...) [with Args = {int, const char*}]’:
../test/./httplib.h:2897:42: error: ‘buf’ may be used uninitialized [-Werror=maybe-uninitialized]
 2897 |   auto sn = snprintf(buf.data(), buf.size() - 1, fmt, args...);
      |                                  ~~~~~~~~^~
In file included from ../test/./httplib.h:134,
                 from ../test/server.cpp:2:
/usr/include/c++/11/array:176:7: note: by argument 1 of type ‘const std::array<char, 2048>*’ to ‘constexpr std::array<_Tp, _Nm>::size_type std::array<_Tp, _Nm>::size() const [with _Tp = char; long unsigned int _Nm = 2048]’ declared here
  176 |       size() const noexcept { return _Nm; }
      |       ^~~~
In file included from ../test/server.cpp:2:
../test/./httplib.h:2892:26: note: ‘buf’ declared here
 2892 |   std::array<char, 2048> buf;
      |                          ^~~
../test/./httplib.h: In member function ‘bool httplib::Client::read_response_line(httplib::Stream&, httplib::Response&)’:
../test/./httplib.h:3761:70: error: ‘buf’ may be used uninitialized [-Werror=maybe-uninitialized]
 3761 |   detail::stream_line_reader line_reader(strm, buf.data(), buf.size());
      |                                                                      ^
In file included from ../test/./httplib.h:134,
                 from ../test/server.cpp:2:
/usr/include/c++/11/array:176:7: note: by argument 1 of type ‘const std::array<char, 2048>*’ to ‘constexpr std::array<_Tp, _Nm>::size_type std::array<_Tp, _Nm>::size() const [with _Tp = char; long unsigned int _Nm = 2048]’ declared here
  176 |       size() const noexcept { return _Nm; }
      |       ^~~~
In file included from ../test/server.cpp:2:
../test/./httplib.h:3759:26: note: ‘buf’ declared here
 3759 |   std::array<char, 2048> buf;
      |                          ^~~
cc1plus: all warnings being treated as errors
ninja: build stopped: subcommand failed.
@kelson42 kelson42 added this to the 10.0.0 milestone Nov 8, 2021
@mgautierfr
Copy link
Member

This is a issue on the dependency httplib (embedded in our test directory).
The fix I've made is here : yhirose/cpp-httplib#1085 (comment)
I've have a draft PR (#633) which apply the patch on our source but it also update the httplib version and now it fails because somehow httplib client cannot access the server.

@kelson42
Copy link
Collaborator

@mgautierfr Can we close rhis ticket now?

@mgautierfr
Copy link
Member

Yes.

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

No branches or pull requests

3 participants