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

Build fails on fresh Ubuntu 23.04, GCC-13 #350

Open
rbeeli opened this issue Feb 5, 2024 · 11 comments · Fixed by #429
Open

Build fails on fresh Ubuntu 23.04, GCC-13 #350

rbeeli opened this issue Feb 5, 2024 · 11 comments · Fixed by #429

Comments

@rbeeli
Copy link

rbeeli commented Feb 5, 2024

Hi,

I'm trying to build the library after a fresh clone and system install according to the build guide from: https://photonlibos.github.io/docs/introduction/how-to-build?os=Ubuntu, but get compiler errors.

dev@dev-1-2:~/Downloads$ git clone https://github.com/alibaba/PhotonLibOS.git
Cloning into 'PhotonLibOS'...
remote: Enumerating objects: 3001, done.
remote: Counting objects: 100% (1636/1636), done.
remote: Compressing objects: 100% (634/634), done.
remote: Total 3001 (delta 1191), reused 1104 (delta 991), pack-reused 1365
Receiving objects: 100% (3001/3001), 1.94 MiB | 15.51 MiB/s, done.
Resolving deltas: 100% (1853/1853), done.
dev@dev-1-2:~/Downloads/$ gcc --version
gcc (Ubuntu 13.2.0-4ubuntu3) 13.2.0
Copyright (C) 2023 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
dev@dev-1-2:~/Downloads/PhotonLibOS$ cmake -B build
-- Will find zlib
-- Found zlib: /usr/lib/x86_64-linux-gnu/libz.so  
-- Will find openssl
-- Found openssl: /usr/lib/x86_64-linux-gnu/libssl.so;/usr/lib/x86_64-linux-gnu/libcrypto.so  
-- Will find curl
-- Found curl: /usr/lib/x86_64-linux-gnu/libcurl.so  
-- Will find aio
-- Found aio: /usr/lib/x86_64-linux-gnu/libaio.so  
-- Configuring done (0.0s)
-- Generating done (0.0s)
-- Build files have been written to: /home/dev/Downloads/PhotonLibOS/build
dev@dev-1-2:~/Downloads/PhotonLibOS$ cmake --build build -j
[  1%] Building CXX object third_party/CMakeFiles/fstack_weak.dir/fstack_weak/fstack_weak.cpp.o
[  3%] Building CXX object CMakeFiles/photon_obj.dir/common/alog.cpp.o
[  4%] Building CXX object CMakeFiles/photon_obj.dir/common/checksum/crc32c.cpp.o
[  6%] Building CXX object CMakeFiles/photon_obj.dir/common/estring.cpp.o
[  7%] Building CXX object CMakeFiles/photon_obj.dir/common/executor/executor.cpp.o
[  9%] Building CXX object third_party/CMakeFiles/easy_weak.dir/easy_weak/easy_weak.cpp.o
[ 11%] Building CXX object CMakeFiles/photon_obj.dir/common/expirecontainer.cpp.o
[ 12%] Building CXX object CMakeFiles/photon_obj.dir/common/identity-pool.cpp.o
[ 14%] Building CXX object CMakeFiles/photon_obj.dir/common/event-loop.cpp.o
[ 15%] Building CXX object CMakeFiles/photon_obj.dir/common/iovector.cpp.o
[ 17%] Building CXX object CMakeFiles/photon_obj.dir/common/memory-stream/memory-stream.cpp.o
[ 19%] Linking CXX static library ../output/libeasy_weak.a
[ 20%] Linking CXX static library ../output/libfstack_weak.a
[ 22%] Building CXX object CMakeFiles/photon_obj.dir/common/perf_counter.cpp.o
[ 23%] Building CXX object CMakeFiles/photon_obj.dir/common/ring.cpp.o
[ 25%] Building CXX object CMakeFiles/photon_obj.dir/common/simple_dom.cpp.o
[ 26%] Building CXX object CMakeFiles/photon_obj.dir/common/stream-messenger/messenger.cpp.o
[ 28%] Building CXX object CMakeFiles/photon_obj.dir/common/stream.cpp.o
[ 30%] Building CXX object CMakeFiles/photon_obj.dir/common/utility.cpp.o
[ 31%] Building CXX object CMakeFiles/photon_obj.dir/common/uuid4.cpp.o
[ 31%] Built target easy_weak
[ 31%] Built target fstack_weak
[ 33%] Building CXX object CMakeFiles/photon_obj.dir/fs/aligned-file.cpp.o
[ 34%] Building CXX object CMakeFiles/photon_obj.dir/fs/async_filesystem.cpp.o
[ 36%] Building CXX object CMakeFiles/photon_obj.dir/fs/exportfs.cpp.o
[ 38%] Building CXX object CMakeFiles/photon_obj.dir/fs/filecopy.cpp.o
[ 39%] Building CXX object CMakeFiles/photon_obj.dir/fs/httpfs/httpfs.cpp.o
[ 41%] Building CXX object CMakeFiles/photon_obj.dir/fs/httpfs/httpfs_v2.cpp.o
[ 42%] Building CXX object CMakeFiles/photon_obj.dir/fs/localfs.cpp.o
[ 44%] Building CXX object CMakeFiles/photon_obj.dir/fs/path.cpp.o
[ 46%] Building CXX object CMakeFiles/photon_obj.dir/fs/subfs.cpp.o
[ 47%] Building CXX object CMakeFiles/photon_obj.dir/fs/throttled-file.cpp.o
[ 49%] Building CXX object CMakeFiles/photon_obj.dir/fs/virtual-file.cpp.o
[ 50%] Building CXX object CMakeFiles/photon_obj.dir/fs/xfile.cpp.o
[ 52%] Building CXX object CMakeFiles/photon_obj.dir/io/reset_handle.cpp.o
[ 53%] Building CXX object CMakeFiles/photon_obj.dir/net/basic_socket.cpp.o
[ 55%] Building CXX object CMakeFiles/photon_obj.dir/io/signal.cpp.o
[ 57%] Building CXX object CMakeFiles/photon_obj.dir/net/curl.cpp.o
[ 58%] Building CXX object CMakeFiles/photon_obj.dir/net/datagram_socket.cpp.o
[ 60%] Building CXX object CMakeFiles/photon_obj.dir/net/http/body.cpp.o
[ 61%] Building CXX object CMakeFiles/photon_obj.dir/net/http/cookie_jar.cpp.o
[ 63%] Building CXX object CMakeFiles/photon_obj.dir/net/http/client.cpp.o
[ 65%] Building CXX object CMakeFiles/photon_obj.dir/net/http/headers.cpp.o
In file included from /home/dev/Downloads/PhotonLibOS/fs/httpfs/httpfs.cpp:27:
/home/dev/Downloads/PhotonLibOS/fs/httpfs/../../net/curl.h: In constructor ‘photon::net::cURL::cURL()’:
/home/dev/Downloads/PhotonLibOS/fs/httpfs/../../net/curl.h:243:16: error: ‘CURLOPT_DNS_USE_GLOBAL_CACHE’ is deprecated: since 7.11.1. Use CURLOPT_SHARE [-Werror=deprecated-declarations]
  243 |         setopt(CURLOPT_DNS_USE_GLOBAL_CACHE, 0L);
      |                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /home/dev/Downloads/PhotonLibOS/fs/httpfs/../../net/curl.h:19:
/usr/include/x86_64-linux-gnu/curl/curl.h:1428:3: note: declared here
 1428 |   CURLOPTDEPRECATED(CURLOPT_DNS_USE_GLOBAL_CACHE, CURLOPTTYPE_LONG, 91,
      |   ^~~~~~~~~~~~~~~~~
/home/dev/Downloads/PhotonLibOS/fs/httpfs/../../net/curl.h: In member function ‘long int photon::net::cURL::PUT(const char*, R*, W*, uint64_t)’:
/home/dev/Downloads/PhotonLibOS/fs/httpfs/../../net/curl.h:416:16: error: ‘CURLOPT_PUT’ is deprecated: since 7.12.1. Use CURLOPT_UPLOAD [-Werror=deprecated-declarations]
  416 |         setopt(CURLOPT_PUT, 1L);
      |                ^~~~~~~~~~~
/usr/include/x86_64-linux-gnu/curl/curl.h:1290:3: note: declared here
 1290 |   CURLOPTDEPRECATED(CURLOPT_PUT, CURLOPTTYPE_LONG, 54,
      |   ^~~~~~~~~~~~~~~~~
[ 66%] Building CXX object CMakeFiles/photon_obj.dir/net/http/message.cpp.o
[ 68%] Building CXX object CMakeFiles/photon_obj.dir/net/http/server.cpp.o
[ 69%] Building CXX object CMakeFiles/photon_obj.dir/net/http/status.cpp.o
[ 71%] Building CXX object CMakeFiles/photon_obj.dir/net/http/url.cpp.o
[ 73%] Building CXX object CMakeFiles/photon_obj.dir/net/kernel_socket.cpp.o
[ 74%] Building CXX object CMakeFiles/photon_obj.dir/net/pooled_socket.cpp.o
[ 76%] Building CXX object CMakeFiles/photon_obj.dir/net/security-context/tls-stream.cpp.o
[ 77%] Building CXX object CMakeFiles/photon_obj.dir/net/utils.cpp.o
[ 79%] Building CXX object CMakeFiles/photon_obj.dir/photon.cpp.o
In file included from /home/dev/Downloads/PhotonLibOS/net/datagram_socket.h:20,
                 from /home/dev/Downloads/PhotonLibOS/net/datagram_socket.cpp:17:
/home/dev/Downloads/PhotonLibOS/include/photon/net/socket.h:47:9: error: ignoring packed attribute because of unpacked non-POD field ‘photon::net::IPAddr::<unnamed union> photon::net::IPAddr::<anonymous>’ [-Werror]
   47 |         union {
      |         ^~~~~
/home/dev/Downloads/PhotonLibOS/include/photon/net/socket.h:155:16: error: ignoring packed attribute because of unpacked non-POD field ‘photon::net::IPAddr photon::net::EndPoint::addr’ [-Werror]
  155 |         IPAddr addr;
      |                ^~~~
/home/dev/Downloads/PhotonLibOS/include/photon/net/socket.h:175:36: error: static assertion failed: Endpoint size incorrect
  175 |     static_assert(sizeof(EndPoint) == 18, "Endpoint size incorrect");
      |                   ~~~~~~~~~~~~~~~~~^~~~~
/home/dev/Downloads/PhotonLibOS/include/photon/net/socket.h:175:36: note: the comparison reduces to ‘(20 == 18)’
In file included from /home/dev/Downloads/PhotonLibOS/net/datagram_socket.h:19:
/home/dev/Downloads/PhotonLibOS/include/photon/common/message.h:45:21: error: ‘virtual ssize_t IMessage::recv(const iovec*, int, Addr*, size_t*, int)’ was hidden [-Werror=overloaded-virtual=]
   45 |     virtual ssize_t recv(const struct iovec* iov, int iovcnt,
      |                     ^~~~
/home/dev/Downloads/PhotonLibOS/net/datagram_socket.h:50:13: note:   by ‘photon::net::IDatagramSocket::recv(B*, S, int)’
   50 |     ssize_t recv(B* buf, S count, int flags = 0) {
      |             ^~~~
/home/dev/Downloads/PhotonLibOS/include/photon/common/message.h:35:21: error: ‘virtual ssize_t IMessage::send(const iovec*, int, const Addr*, size_t, int)’ was hidden [-Werror=overloaded-virtual=]
   35 |     virtual ssize_t send(const struct iovec* iov, int iovcnt,
      |                     ^~~~
/home/dev/Downloads/PhotonLibOS/net/datagram_socket.h:46:13: note:   by ‘photon::net::IDatagramSocket::send(B*, S, int)’
   46 |     ssize_t send(B* buf, S count, int flags = 0) {
      |             ^~~~
/home/dev/Downloads/PhotonLibOS/include/photon/common/message.h:45:21: error: ‘virtual ssize_t IMessage::recv(const iovec*, int, Addr*, size_t*, int)’ was hidden [-Werror=overloaded-virtual=]
   45 |     virtual ssize_t recv(const struct iovec* iov, int iovcnt,
      |                     ^~~~
/home/dev/Downloads/PhotonLibOS/net/datagram_socket.h:50:13: note:   by ‘photon::net::IDatagramSocket::recv(B*, S, int)’
   50 |     ssize_t recv(B* buf, S count, int flags = 0) {
      |             ^~~~
/home/dev/Downloads/PhotonLibOS/include/photon/common/message.h:35:21: error: ‘virtual ssize_t IMessage::send(const iovec*, int, const Addr*, size_t, int)’ was hidden [-Werror=overloaded-virtual=]
   35 |     virtual ssize_t send(const struct iovec* iov, int iovcnt,
      |                     ^~~~
/home/dev/Downloads/PhotonLibOS/net/datagram_socket.h:46:13: note:   by ‘photon::net::IDatagramSocket::send(B*, S, int)’
   46 |     ssize_t send(B* buf, S count, int flags = 0) {
      |             ^~~~
/home/dev/Downloads/PhotonLibOS/include/photon/common/message.h:45:21: error: ‘virtual ssize_t IMessage::recv(const iovec*, int, Addr*, size_t*, int)’ was hidden [-Werror=overloaded-virtual=]
   45 |     virtual ssize_t recv(const struct iovec* iov, int iovcnt,
      |                     ^~~~
/home/dev/Downloads/PhotonLibOS/net/datagram_socket.h:50:13: note:   by ‘photon::net::IDatagramSocket::recv(B*, S, int)’
   50 |     ssize_t recv(B* buf, S count, int flags = 0) {
      |             ^~~~
/home/dev/Downloads/PhotonLibOS/include/photon/common/message.h:35:21: error: ‘virtual ssize_t IMessage::send(const iovec*, int, const Addr*, size_t, int)’ was hidden [-Werror=overloaded-virtual=]
   35 |     virtual ssize_t send(const struct iovec* iov, int iovcnt,
      |                     ^~~~
/home/dev/Downloads/PhotonLibOS/net/datagram_socket.h:46:13: note:   by ‘photon::net::IDatagramSocket::send(B*, S, int)’
   46 |     ssize_t send(B* buf, S count, int flags = 0) {
      |             ^~~~
[ 80%] Building CXX object CMakeFiles/photon_obj.dir/rpc/out-of-order-execution.cpp.o
[ 82%] Building CXX object CMakeFiles/photon_obj.dir/rpc/rpc.cpp.o
In file included from /home/dev/Downloads/PhotonLibOS/net/basic_socket.cpp:31:
/home/dev/Downloads/PhotonLibOS/include/photon/net/socket.h:47:9: error: ignoring packed attribute because of unpacked non-POD field ‘photon::net::IPAddr::<unnamed union> photon::net::IPAddr::<anonymous>’ [-Werror]
   47 |         union {
      |         ^~~~~
/home/dev/Downloads/PhotonLibOS/include/photon/net/socket.h:155:16: error: ignoring packed attribute because of unpacked non-POD field ‘photon::net::IPAddr photon::net::EndPoint::addr’ [-Werror]
  155 |         IPAddr addr;
      |                ^~~~
/home/dev/Downloads/PhotonLibOS/include/photon/net/socket.h:175:36: error: static assertion failed: Endpoint size incorrect
  175 |     static_assert(sizeof(EndPoint) == 18, "Endpoint size incorrect");
      |                   ~~~~~~~~~~~~~~~~~^~~~~
/home/dev/Downloads/PhotonLibOS/include/photon/net/socket.h:175:36: note: the comparison reduces to ‘(20 == 18)’
[ 84%] Building CXX object CMakeFiles/photon_obj.dir/thread/stack-allocator.cpp.o
In file included from /home/dev/Downloads/PhotonLibOS/net/http/body.cpp:22:
/home/dev/Downloads/PhotonLibOS/include/photon/net/socket.h:47:9: error: ignoring packed attribute because of unpacked non-POD field ‘photon::net::IPAddr::<unnamed union> photon::net::IPAddr::<anonymous>’ [-Werror]
   47 |         union {
      |         ^~~~~
/home/dev/Downloads/PhotonLibOS/include/photon/net/socket.h:155:16: error: ignoring packed attribute because of unpacked non-POD field ‘photon::net::IPAddr photon::net::EndPoint::addr’ [-Werror]
  155 |         IPAddr addr;
      |                ^~~~
/home/dev/Downloads/PhotonLibOS/include/photon/net/socket.h:175:36: error: static assertion failed: Endpoint size incorrect
  175 |     static_assert(sizeof(EndPoint) == 18, "Endpoint size incorrect");
      |                   ~~~~~~~~~~~~~~~~~^~~~~
/home/dev/Downloads/PhotonLibOS/include/photon/net/socket.h:175:36: note: the comparison reduces to ‘(20 == 18)’
[ 85%] Building CXX object CMakeFiles/photon_obj.dir/thread/std-compat.cpp.o
[ 87%] Building CXX object CMakeFiles/photon_obj.dir/thread/thread-key.cpp.o
[ 88%] Building CXX object CMakeFiles/photon_obj.dir/thread/thread-pool.cpp.o
[ 90%] Building CXX object CMakeFiles/photon_obj.dir/thread/thread.cpp.o
[ 92%] Building CXX object CMakeFiles/photon_obj.dir/thread/workerpool.cpp.o
[ 93%] Building CXX object CMakeFiles/photon_obj.dir/io/aio-wrapper.cpp.o
[ 95%] Building CXX object CMakeFiles/photon_obj.dir/io/epoll.cpp.o
[ 96%] Building CXX object CMakeFiles/photon_obj.dir/io/epoll-ng.cpp.o
In file included from /home/dev/Downloads/PhotonLibOS/net/http/server.h:23,
                 from /home/dev/Downloads/PhotonLibOS/net/http/server.cpp:17:
/home/dev/Downloads/PhotonLibOS/include/photon/net/socket.h:47:9: error: ignoring packed attribute because of unpacked non-POD field ‘photon::net::IPAddr::<unnamed union> photon::net::IPAddr::<anonymous>’ [-Werror]
   47 |         union {
      |         ^~~~~
/home/dev/Downloads/PhotonLibOS/include/photon/net/socket.h:155:16: error: ignoring packed attribute because of unpacked non-POD field ‘photon::net::IPAddr photon::net::EndPoint::addr’ [-Werror]
  155 |         IPAddr addr;
      |                ^~~~
/home/dev/Downloads/PhotonLibOS/include/photon/net/socket.h:175:36: error: static assertion failed: Endpoint size incorrect
  175 |     static_assert(sizeof(EndPoint) == 18, "Endpoint size incorrect");
      |                   ~~~~~~~~~~~~~~~~~^~~~~
/home/dev/Downloads/PhotonLibOS/include/photon/net/socket.h:175:36: note: the comparison reduces to ‘(20 == 18)’
cc1plus: all warnings being treated as errors
gmake[2]: *** [CMakeFiles/photon_obj.dir/build.make:524: CMakeFiles/photon_obj.dir/net/datagram_socket.cpp.o] Error 1
gmake[2]: *** Waiting for unfinished jobs....
In file included from /home/dev/Downloads/PhotonLibOS/net/pooled_socket.cpp:17:
/home/dev/Downloads/PhotonLibOS/net/socket.h:47:9: error: ignoring packed attribute because of unpacked non-POD field ‘photon::net::IPAddr::<unnamed union> photon::net::IPAddr::<anonymous>’ [-Werror]
   47 |         union {
      |         ^~~~~
/home/dev/Downloads/PhotonLibOS/net/socket.h:155:16: error: ignoring packed attribute because of unpacked non-POD field ‘photon::net::IPAddr photon::net::EndPoint::addr’ [-Werror]
  155 |         IPAddr addr;
      |                ^~~~
/home/dev/Downloads/PhotonLibOS/net/socket.h:175:36: error: static assertion failed: Endpoint size incorrect
  175 |     static_assert(sizeof(EndPoint) == 18, "Endpoint size incorrect");
      |                   ~~~~~~~~~~~~~~~~~^~~~~
/home/dev/Downloads/PhotonLibOS/net/socket.h:175:36: note: the comparison reduces to ‘(20 == 18)’
In file included from /home/dev/Downloads/PhotonLibOS/net/kernel_socket.cpp:17:
/home/dev/Downloads/PhotonLibOS/net/socket.h:47:9: error: ignoring packed attribute because of unpacked non-POD field ‘photon::net::IPAddr::<unnamed union> photon::net::IPAddr::<anonymous>’ [-Werror]
   47 |         union {
      |         ^~~~~
/home/dev/Downloads/PhotonLibOS/net/socket.h:155:16: error: ignoring packed attribute because of unpacked non-POD field ‘photon::net::IPAddr photon::net::EndPoint::addr’ [-Werror]
  155 |         IPAddr addr;
      |                ^~~~
/home/dev/Downloads/PhotonLibOS/net/socket.h:175:36: error: static assertion failed: Endpoint size incorrect
  175 |     static_assert(sizeof(EndPoint) == 18, "Endpoint size incorrect");
      |                   ~~~~~~~~~~~~~~~~~^~~~~
/home/dev/Downloads/PhotonLibOS/net/socket.h:175:36: note: the comparison reduces to ‘(20 == 18)’
cc1plus: all warnings being treated as errors
gmake[2]: *** [CMakeFiles/photon_obj.dir/build.make:538: CMakeFiles/photon_obj.dir/net/http/body.cpp.o] Error 1
In file included from /home/dev/Downloads/PhotonLibOS/include/photon/net/http/client.h:27,
                 from /home/dev/Downloads/PhotonLibOS/fs/httpfs/httpfs_v2.cpp:26:
/home/dev/Downloads/PhotonLibOS/include/photon/net/socket.h:47:9: error: ignoring packed attribute because of unpacked non-POD field ‘photon::net::IPAddr::<unnamed union> photon::net::IPAddr::<anonymous>’ [-Werror]
   47 |         union {
      |         ^~~~~
/home/dev/Downloads/PhotonLibOS/include/photon/net/socket.h:155:16: error: ignoring packed attribute because of unpacked non-POD field ‘photon::net::IPAddr photon::net::EndPoint::addr’ [-Werror]
  155 |         IPAddr addr;
      |                ^~~~
/home/dev/Downloads/PhotonLibOS/include/photon/net/socket.h:175:36: error: static assertion failed: Endpoint size incorrect
  175 |     static_assert(sizeof(EndPoint) == 18, "Endpoint size incorrect");
      |                   ~~~~~~~~~~~~~~~~~^~~~~
/home/dev/Downloads/PhotonLibOS/include/photon/net/socket.h:175:36: note: the comparison reduces to ‘(20 == 18)’
In file included from /home/dev/Downloads/PhotonLibOS/rpc/rpc.h:23,
                 from /home/dev/Downloads/PhotonLibOS/rpc/rpc.cpp:17:
/home/dev/Downloads/PhotonLibOS/include/photon/net/socket.h:47:9: error: ignoring packed attribute because of unpacked non-POD field ‘photon::net::IPAddr::<unnamed union> photon::net::IPAddr::<anonymous>’ [-Werror]
   47 |         union {
      |         ^~~~~
/home/dev/Downloads/PhotonLibOS/include/photon/net/socket.h:155:16: error: ignoring packed attribute because of unpacked non-POD field ‘photon::net::IPAddr photon::net::EndPoint::addr’ [-Werror]
  155 |         IPAddr addr;
      |                ^~~~
/home/dev/Downloads/PhotonLibOS/include/photon/net/socket.h:175:36: error: static assertion failed: Endpoint size incorrect
  175 |     static_assert(sizeof(EndPoint) == 18, "Endpoint size incorrect");
      |                   ~~~~~~~~~~~~~~~~~^~~~~
/home/dev/Downloads/PhotonLibOS/include/photon/net/socket.h:175:36: note: the comparison reduces to ‘(20 == 18)’
In file included from /home/dev/Downloads/PhotonLibOS/net/utils.h:25,
                 from /home/dev/Downloads/PhotonLibOS/net/utils.cpp:17:
/home/dev/Downloads/PhotonLibOS/include/photon/net/socket.h:47:9: error: ignoring packed attribute because of unpacked non-POD field ‘photon::net::IPAddr::<unnamed union> photon::net::IPAddr::<anonymous>’ [-Werror]
   47 |         union {
      |         ^~~~~
/home/dev/Downloads/PhotonLibOS/include/photon/net/socket.h:155:16: error: ignoring packed attribute because of unpacked non-POD field ‘photon::net::IPAddr photon::net::EndPoint::addr’ [-Werror]
  155 |         IPAddr addr;
      |                ^~~~
In file included from /home/dev/Downloads/PhotonLibOS/net/security-context/tls-stream.cpp:25:
/home/dev/Downloads/PhotonLibOS/include/photon/net/socket.h:47:9: error: ignoring packed attribute because of unpacked non-POD field ‘photon::net::IPAddr::<unnamed union> photon::net::IPAddr::<anonymous>’ [-Werror]
   47 |         union {
      |         ^~~~~
/home/dev/Downloads/PhotonLibOS/include/photon/net/socket.h:175:36: error: static assertion failed: Endpoint size incorrect
  175 |     static_assert(sizeof(EndPoint) == 18, "Endpoint size incorrect");
      |                   ~~~~~~~~~~~~~~~~~^~~~~
/home/dev/Downloads/PhotonLibOS/include/photon/net/socket.h:155:16: error: ignoring packed attribute because of unpacked non-POD field ‘photon::net::IPAddr photon::net::EndPoint::addr’ [-Werror]
  155 |         IPAddr addr;
      |                ^~~~
/home/dev/Downloads/PhotonLibOS/include/photon/net/socket.h:175:36: note: the comparison reduces to ‘(20 == 18)’
/home/dev/Downloads/PhotonLibOS/include/photon/net/socket.h:175:36: error: static assertion failed: Endpoint size incorrect
  175 |     static_assert(sizeof(EndPoint) == 18, "Endpoint size incorrect");
      |                   ~~~~~~~~~~~~~~~~~^~~~~
/home/dev/Downloads/PhotonLibOS/include/photon/net/socket.h:175:36: note: the comparison reduces to ‘(20 == 18)’
In file included from /home/dev/Downloads/PhotonLibOS/photon.cpp:29:
/home/dev/Downloads/PhotonLibOS/net/curl.h: In constructor ‘photon::net::cURL::cURL()’:
/home/dev/Downloads/PhotonLibOS/net/curl.h:243:16: error: ‘CURLOPT_DNS_USE_GLOBAL_CACHE’ is deprecated: since 7.11.1. Use CURLOPT_SHARE [-Werror=deprecated-declarations]
  243 |         setopt(CURLOPT_DNS_USE_GLOBAL_CACHE, 0L);
      |                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /home/dev/Downloads/PhotonLibOS/net/curl.h:19:
/usr/include/x86_64-linux-gnu/curl/curl.h:1428:3: note: declared here
 1428 |   CURLOPTDEPRECATED(CURLOPT_DNS_USE_GLOBAL_CACHE, CURLOPTTYPE_LONG, 91,
      |   ^~~~~~~~~~~~~~~~~
/home/dev/Downloads/PhotonLibOS/net/curl.h: In member function ‘long int photon::net::cURL::PUT(const char*, R*, W*, uint64_t)’:
/home/dev/Downloads/PhotonLibOS/net/curl.h:416:16: error: ‘CURLOPT_PUT’ is deprecated: since 7.12.1. Use CURLOPT_UPLOAD [-Werror=deprecated-declarations]
  416 |         setopt(CURLOPT_PUT, 1L);
      |                ^~~~~~~~~~~
/usr/include/x86_64-linux-gnu/curl/curl.h:1290:3: note: declared here
 1290 |   CURLOPTDEPRECATED(CURLOPT_PUT, CURLOPTTYPE_LONG, 54,
      |   ^~~~~~~~~~~~~~~~~
In file included from /home/dev/Downloads/PhotonLibOS/photon.cpp:30:
/home/dev/Downloads/PhotonLibOS/net/socket.h: At global scope:
/home/dev/Downloads/PhotonLibOS/net/socket.h:47:9: error: ignoring packed attribute because of unpacked non-POD field ‘photon::net::IPAddr::<unnamed union> photon::net::IPAddr::<anonymous>’ [-Werror]
   47 |         union {
      |         ^~~~~
cc1plus: all warnings being treated as errors
gmake[2]: *** [CMakeFiles/photon_obj.dir/build.make:496: CMakeFiles/photon_obj.dir/net/basic_socket.cpp.o] Error 1
In file included from /home/dev/Downloads/PhotonLibOS/net/http/client.h:27,
                 from /home/dev/Downloads/PhotonLibOS/net/http/client.cpp:17:
/home/dev/Downloads/PhotonLibOS/include/photon/net/socket.h:47:9: error: ignoring packed attribute because of unpacked non-POD field ‘photon::net::IPAddr::<unnamed union> photon::net::IPAddr::<anonymous>’ [-Werror]
   47 |         union {
      |         ^~~~~
/home/dev/Downloads/PhotonLibOS/include/photon/net/socket.h:155:16: error: ignoring packed attribute because of unpacked non-POD field ‘photon::net::IPAddr photon::net::EndPoint::addr’ [-Werror]
  155 |         IPAddr addr;
      |                ^~~~
/home/dev/Downloads/PhotonLibOS/include/photon/net/socket.h:175:36: error: static assertion failed: Endpoint size incorrect
  175 |     static_assert(sizeof(EndPoint) == 18, "Endpoint size incorrect");
      |                   ~~~~~~~~~~~~~~~~~^~~~~
/home/dev/Downloads/PhotonLibOS/include/photon/net/socket.h:175:36: note: the comparison reduces to ‘(20 == 18)’
/home/dev/Downloads/PhotonLibOS/net/socket.h:155:16: error: ignoring packed attribute because of unpacked non-POD field ‘photon::net::IPAddr photon::net::EndPoint::addr’ [-Werror]
  155 |         IPAddr addr;
      |                ^~~~
/home/dev/Downloads/PhotonLibOS/net/socket.h:175:36: error: static assertion failed: Endpoint size incorrect
  175 |     static_assert(sizeof(EndPoint) == 18, "Endpoint size incorrect");
      |                   ~~~~~~~~~~~~~~~~~^~~~~
/home/dev/Downloads/PhotonLibOS/net/socket.h:175:36: note: the comparison reduces to ‘(20 == 18)’
In file included from /home/dev/Downloads/PhotonLibOS/net/http/client.h:27,
                 from /home/dev/Downloads/PhotonLibOS/net/http/cookie_jar.cpp:20:
/home/dev/Downloads/PhotonLibOS/include/photon/net/socket.h:47:9: error: ignoring packed attribute because of unpacked non-POD field ‘photon::net::IPAddr::<unnamed union> photon::net::IPAddr::<anonymous>’ [-Werror]
   47 |         union {
      |         ^~~~~
/home/dev/Downloads/PhotonLibOS/include/photon/net/socket.h:155:16: error: ignoring packed attribute because of unpacked non-POD field ‘photon::net::IPAddr photon::net::EndPoint::addr’ [-Werror]
  155 |         IPAddr addr;
      |                ^~~~
/home/dev/Downloads/PhotonLibOS/include/photon/net/socket.h:175:36: error: static assertion failed: Endpoint size incorrect
  175 |     static_assert(sizeof(EndPoint) == 18, "Endpoint size incorrect");
      |                   ~~~~~~~~~~~~~~~~~^~~~~
/home/dev/Downloads/PhotonLibOS/include/photon/net/socket.h:175:36: note: the comparison reduces to ‘(20 == 18)’
In file included from /home/dev/Downloads/PhotonLibOS/net/http/message.cpp:22:
/home/dev/Downloads/PhotonLibOS/include/photon/net/socket.h:47:9: error: ignoring packed attribute because of unpacked non-POD field ‘photon::net::IPAddr::<unnamed union> photon::net::IPAddr::<anonymous>’ [-Werror]
   47 |         union {
      |         ^~~~~
/home/dev/Downloads/PhotonLibOS/include/photon/net/socket.h:155:16: error: ignoring packed attribute because of unpacked non-POD field ‘photon::net::IPAddr photon::net::EndPoint::addr’ [-Werror]
  155 |         IPAddr addr;
      |                ^~~~
/home/dev/Downloads/PhotonLibOS/include/photon/net/socket.h:175:36: error: static assertion failed: Endpoint size incorrect
  175 |     static_assert(sizeof(EndPoint) == 18, "Endpoint size incorrect");
      |                   ~~~~~~~~~~~~~~~~~^~~~~
/home/dev/Downloads/PhotonLibOS/include/photon/net/socket.h:175:36: note: the comparison reduces to ‘(20 == 18)’
cc1plus: all warnings being treated as errors
gmake[2]: *** [CMakeFiles/photon_obj.dir/build.make:664: CMakeFiles/photon_obj.dir/net/pooled_socket.cpp.o] Error 1
/home/dev/Downloads/PhotonLibOS/net/utils.cpp:110:8: note: offset of packed bit-field ‘photon::net::xlator::b’ has changed in GCC 4.4
  110 | struct xlator {
      |        ^~~~~~
cc1plus: all warnings being treated as errors
/home/dev/Downloads/PhotonLibOS/net/utils.cpp:110:8: note: offset of packed bit-field ‘photon::net::xlator::c’ has changed in GCC 4.4
gmake[2]: *** [CMakeFiles/photon_obj.dir/build.make:706: CMakeFiles/photon_obj.dir/photon.cpp.o] Error 1
cc1plus: all warnings being treated as errors
gmake[2]: *** [CMakeFiles/photon_obj.dir/build.make:566: CMakeFiles/photon_obj.dir/net/http/cookie_jar.cpp.o] Error 1
cc1plus: all warnings being treated as errors
gmake[2]: *** [CMakeFiles/photon_obj.dir/build.make:370: CMakeFiles/photon_obj.dir/fs/httpfs/httpfs_v2.cpp.o] Error 1
cc1plus: all warnings being treated as errors
gmake[2]: *** [CMakeFiles/photon_obj.dir/build.make:678: CMakeFiles/photon_obj.dir/net/security-context/tls-stream.cpp.o] Error 1
cc1plus: all warnings being treated as errors
gmake[2]: *** [CMakeFiles/photon_obj.dir/build.make:356: CMakeFiles/photon_obj.dir/fs/httpfs/httpfs.cpp.o] Error 1
cc1plus: all warnings being treated as errors
gmake[2]: *** [CMakeFiles/photon_obj.dir/build.make:692: CMakeFiles/photon_obj.dir/net/utils.cpp.o] Error 1
In file included from /home/dev/Downloads/PhotonLibOS/fs/aligned-file.cpp:22:
In member function ‘size_t iovector::push_back(iovec)’,
    inlined from ‘size_t iovector::push_back(size_t)’ at /home/dev/Downloads/PhotonLibOS/include/photon/common/iovector.h:385:22,
    inlined from ‘virtual ssize_t photon::fs::AlignedFileAdaptor::preadv2_mutable(iovec*, int, off_t, int)’ at /home/dev/Downloads/PhotonLibOS/fs/aligned-file.cpp:165:38:
/home/dev/Downloads/PhotonLibOS/include/photon/common/iovector.h:372:23: error: array subscript 65534 is outside the bounds of an interior zero-length array ‘iovec [0]’ [-Werror=zero-length-bounds]
  372 |         iovs[iov_end++] = iov;
      |         ~~~~~~~~~~~~~~^
/home/dev/Downloads/PhotonLibOS/include/photon/common/iovector.h: In member function ‘virtual ssize_t photon::fs::AlignedFileAdaptor::preadv2_mutable(iovec*, int, off_t, int)’:
/home/dev/Downloads/PhotonLibOS/include/photon/common/iovector.h:830:18: note: while referencing ‘iovector::iovs’
  830 |     struct iovec iovs[0];
      |                  ^~~~
In member function ‘size_t iovector::push_back(iovec)’,
    inlined from ‘size_t iovector::push_back(size_t)’ at /home/dev/Downloads/PhotonLibOS/include/photon/common/iovector.h:385:22,
    inlined from ‘virtual ssize_t photon::fs::AlignedFileAdaptor::preadv2_mutable(iovec*, int, off_t, int)’ at /home/dev/Downloads/PhotonLibOS/fs/aligned-file.cpp:165:38:
/home/dev/Downloads/PhotonLibOS/include/photon/common/iovector.h:372:23: error: array subscript 65534 is outside the bounds of an interior zero-length array ‘iovec [0]’ [-Werror=zero-length-bounds]
  372 |         iovs[iov_end++] = iov;
      |         ~~~~~~~~~~~~~~^
/home/dev/Downloads/PhotonLibOS/include/photon/common/iovector.h: In member function ‘virtual ssize_t photon::fs::AlignedFileAdaptor::preadv2_mutable(iovec*, int, off_t, int)’:
/home/dev/Downloads/PhotonLibOS/include/photon/common/iovector.h:830:18: note: while referencing ‘iovector::iovs’
  830 |     struct iovec iovs[0];
      |                  ^~~~
cc1plus: all warnings being treated as errors
gmake[2]: *** [CMakeFiles/photon_obj.dir/build.make:594: CMakeFiles/photon_obj.dir/net/http/message.cpp.o] Error 1
In member function ‘size_t iovector::push_back(iovec)’,
    inlined from ‘size_t iovector::push_back(size_t)’ at /home/dev/Downloads/PhotonLibOS/include/photon/common/iovector.h:385:22,
    inlined from ‘virtual ssize_t photon::fs::AlignedFileAdaptor::pwritev2_mutable(iovec*, int, off_t, int)’ at /home/dev/Downloads/PhotonLibOS/fs/aligned-file.cpp:207:38:
/home/dev/Downloads/PhotonLibOS/include/photon/common/iovector.h:372:23: error: array subscript 65534 is outside the bounds of an interior zero-length array ‘iovec [0]’ [-Werror=zero-length-bounds]
  372 |         iovs[iov_end++] = iov;
      |         ~~~~~~~~~~~~~~^
/home/dev/Downloads/PhotonLibOS/include/photon/common/iovector.h: In member function ‘virtual ssize_t photon::fs::AlignedFileAdaptor::pwritev2_mutable(iovec*, int, off_t, int)’:
/home/dev/Downloads/PhotonLibOS/include/photon/common/iovector.h:830:18: note: while referencing ‘iovector::iovs’
  830 |     struct iovec iovs[0];
      |                  ^~~~
In member function ‘size_t iovector::push_back(iovec)’,
    inlined from ‘size_t iovector::push_back(size_t)’ at /home/dev/Downloads/PhotonLibOS/include/photon/common/iovector.h:385:22,
    inlined from ‘virtual ssize_t photon::fs::AlignedFileAdaptor::pwritev2_mutable(iovec*, int, off_t, int)’ at /home/dev/Downloads/PhotonLibOS/fs/aligned-file.cpp:207:38:
/home/dev/Downloads/PhotonLibOS/include/photon/common/iovector.h:372:23: error: array subscript 65534 is outside the bounds of an interior zero-length array ‘iovec [0]’ [-Werror=zero-length-bounds]
  372 |         iovs[iov_end++] = iov;
      |         ~~~~~~~~~~~~~~^
/home/dev/Downloads/PhotonLibOS/include/photon/common/iovector.h: In member function ‘virtual ssize_t photon::fs::AlignedFileAdaptor::pwritev2_mutable(iovec*, int, off_t, int)’:
/home/dev/Downloads/PhotonLibOS/include/photon/common/iovector.h:830:18: note: while referencing ‘iovector::iovs’
  830 |     struct iovec iovs[0];
      |                  ^~~~
cc1plus: all warnings being treated as errors
gmake[2]: *** [CMakeFiles/photon_obj.dir/build.make:734: CMakeFiles/photon_obj.dir/rpc/rpc.cpp.o] Error 1
cc1plus: all warnings being treated as errors
gmake[2]: *** [CMakeFiles/photon_obj.dir/build.make:608: CMakeFiles/photon_obj.dir/net/http/server.cpp.o] Error 1
cc1plus: all warnings being treated as errors
gmake[2]: *** [CMakeFiles/photon_obj.dir/build.make:300: CMakeFiles/photon_obj.dir/fs/aligned-file.cpp.o] Error 1
cc1plus: all warnings being treated as errors
gmake[2]: *** [CMakeFiles/photon_obj.dir/build.make:650: CMakeFiles/photon_obj.dir/net/kernel_socket.cpp.o] Error 1
cc1plus: all warnings being treated as errors
gmake[2]: *** [CMakeFiles/photon_obj.dir/build.make:552: CMakeFiles/photon_obj.dir/net/http/client.cpp.o] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:108: CMakeFiles/photon_obj.dir/all] Error 2
gmake: *** [Makefile:91: all] Error 2

Is GCC-13 supported? If not, what are the compiler requirements?
Also, would it work with newer C++ standards, e.g. C++20 or C++23?

Thank you.

@lihuiba
Copy link
Collaborator

lihuiba commented Feb 6, 2024

Which branch are you using?

@rbeeli
Copy link
Author

rbeeli commented Feb 6, 2024

@lihuiba It was on the main branch, shall I try a different one?

@lihuiba
Copy link
Collaborator

lihuiba commented Feb 6, 2024

We fixed some compiling issue in the main branch for high versions of GCC just a few days ago, and obviously we need some further work for GCC 13.

@beef9999
Copy link
Collaborator

beef9999 commented Feb 6, 2024

add_compile_options(-Wall -Werror -Wno-error=pragmas)

@rbeeli You can comment out the -Werror here and temporarily make it work.

We will set up github CI on latest Ubuntu to verify high version gcc.

@rbeeli
Copy link
Author

rbeeli commented Feb 6, 2024

@beef9999 Just tried it with:

add_compile_options(-Wall -Wno-error=pragmas)  # -Werror 

But still get the following errors on latest main branch, some static assertions fail error: static assertion failed:

dev@dev-1-2:~/Downloads/PhotonLibOS$ cmake --build build -j
[  1%] Building CXX object third_party/CMakeFiles/fstack_weak.dir/fstack_weak/fstack_weak.cpp.o
[  3%] Building CXX object CMakeFiles/photon_obj.dir/common/executor/executor.cpp.o
[  4%] Building CXX object third_party/CMakeFiles/easy_weak.dir/easy_weak/easy_weak.cpp.o
[  6%] Building CXX object CMakeFiles/photon_obj.dir/common/checksum/crc32c.cpp.o
[  7%] Building CXX object CMakeFiles/photon_obj.dir/common/alog.cpp.o
[  9%] Building CXX object CMakeFiles/photon_obj.dir/common/iovector.cpp.o
[ 11%] Building CXX object CMakeFiles/photon_obj.dir/common/identity-pool.cpp.o
[ 12%] Building CXX object CMakeFiles/photon_obj.dir/common/expirecontainer.cpp.o
[ 14%] Building CXX object CMakeFiles/photon_obj.dir/common/estring.cpp.o
[ 15%] Building CXX object CMakeFiles/photon_obj.dir/common/perf_counter.cpp.o
[ 19%] Building CXX object CMakeFiles/photon_obj.dir/common/memory-stream/memory-stream.cpp.o
[ 19%] Building CXX object CMakeFiles/photon_obj.dir/common/event-loop.cpp.o
[ 20%] Building CXX object CMakeFiles/photon_obj.dir/common/uuid4.cpp.o
[ 22%] Building CXX object CMakeFiles/photon_obj.dir/common/stream.cpp.o
[ 23%] Building CXX object CMakeFiles/photon_obj.dir/fs/aligned-file.cpp.o
[ 25%] Building CXX object CMakeFiles/photon_obj.dir/common/stream-messenger/messenger.cpp.o
[ 28%] Building CXX object CMakeFiles/photon_obj.dir/common/simple_dom.cpp.o
[ 28%] Building CXX object CMakeFiles/photon_obj.dir/common/ring.cpp.o
[ 30%] Building CXX object CMakeFiles/photon_obj.dir/common/utility.cpp.o
[ 31%] Linking CXX static library ../output/libfstack_weak.a
[ 33%] Building CXX object CMakeFiles/photon_obj.dir/fs/async_filesystem.cpp.o
[ 34%] Linking CXX static library ../output/libeasy_weak.a
[ 36%] Building CXX object CMakeFiles/photon_obj.dir/fs/exportfs.cpp.o
[ 38%] Building CXX object CMakeFiles/photon_obj.dir/fs/filecopy.cpp.o
[ 39%] Building CXX object CMakeFiles/photon_obj.dir/fs/httpfs/httpfs.cpp.o
[ 41%] Building CXX object CMakeFiles/photon_obj.dir/fs/httpfs/httpfs_v2.cpp.o
[ 42%] Building CXX object CMakeFiles/photon_obj.dir/fs/localfs.cpp.o
[ 42%] Built target easy_weak
[ 42%] Built target fstack_weak
[ 44%] Building CXX object CMakeFiles/photon_obj.dir/fs/path.cpp.o
[ 46%] Building CXX object CMakeFiles/photon_obj.dir/fs/throttled-file.cpp.o
[ 47%] Building CXX object CMakeFiles/photon_obj.dir/fs/subfs.cpp.o
[ 49%] Building CXX object CMakeFiles/photon_obj.dir/fs/virtual-file.cpp.o
[ 50%] Building CXX object CMakeFiles/photon_obj.dir/fs/xfile.cpp.o
[ 52%] Building CXX object CMakeFiles/photon_obj.dir/io/signal.cpp.o
[ 53%] Building CXX object CMakeFiles/photon_obj.dir/io/reset_handle.cpp.o
[ 55%] Building CXX object CMakeFiles/photon_obj.dir/net/basic_socket.cpp.o
[ 57%] Building CXX object CMakeFiles/photon_obj.dir/net/curl.cpp.o
[ 58%] Building CXX object CMakeFiles/photon_obj.dir/net/datagram_socket.cpp.o
[ 60%] Building CXX object CMakeFiles/photon_obj.dir/net/http/body.cpp.o
[ 61%] Building CXX object CMakeFiles/photon_obj.dir/net/http/client.cpp.o
[ 63%] Building CXX object CMakeFiles/photon_obj.dir/net/http/cookie_jar.cpp.o
[ 65%] Building CXX object CMakeFiles/photon_obj.dir/net/http/headers.cpp.o
[ 66%] Building CXX object CMakeFiles/photon_obj.dir/net/http/message.cpp.o
[ 68%] Building CXX object CMakeFiles/photon_obj.dir/net/http/server.cpp.o
[ 69%] Building CXX object CMakeFiles/photon_obj.dir/net/http/status.cpp.o
[ 71%] Building CXX object CMakeFiles/photon_obj.dir/net/http/url.cpp.o
[ 73%] Building CXX object CMakeFiles/photon_obj.dir/net/kernel_socket.cpp.o
[ 74%] Building CXX object CMakeFiles/photon_obj.dir/net/pooled_socket.cpp.o
[ 76%] Building CXX object CMakeFiles/photon_obj.dir/net/security-context/tls-stream.cpp.o
[ 77%] Building CXX object CMakeFiles/photon_obj.dir/net/utils.cpp.o
In file included from /home/dev/Downloads/PhotonLibOS/fs/httpfs/httpfs.cpp:27:
/home/dev/Downloads/PhotonLibOS/fs/httpfs/../../net/curl.h: In constructor ‘photon::net::cURL::cURL()’:
/home/dev/Downloads/PhotonLibOS/fs/httpfs/../../net/curl.h:243:16: warning: ‘CURLOPT_DNS_USE_GLOBAL_CACHE’ is deprecated: since 7.11.1. Use CURLOPT_SHARE [-Wdeprecated-declarations]
  243 |         setopt(CURLOPT_DNS_USE_GLOBAL_CACHE, 0L);
      |                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /home/dev/Downloads/PhotonLibOS/fs/httpfs/../../net/curl.h:19:
/usr/include/x86_64-linux-gnu/curl/curl.h:1428:3: note: declared here
 1428 |   CURLOPTDEPRECATED(CURLOPT_DNS_USE_GLOBAL_CACHE, CURLOPTTYPE_LONG, 91,
      |   ^~~~~~~~~~~~~~~~~
/home/dev/Downloads/PhotonLibOS/fs/httpfs/../../net/curl.h: In member function ‘long int photon::net::cURL::PUT(const char*, R*, W*, uint64_t)’:
/home/dev/Downloads/PhotonLibOS/fs/httpfs/../../net/curl.h:416:16: warning: ‘CURLOPT_PUT’ is deprecated: since 7.12.1. Use CURLOPT_UPLOAD [-Wdeprecated-declarations]
  416 |         setopt(CURLOPT_PUT, 1L);
      |                ^~~~~~~~~~~
/usr/include/x86_64-linux-gnu/curl/curl.h:1290:3: note: declared here
 1290 |   CURLOPTDEPRECATED(CURLOPT_PUT, CURLOPTTYPE_LONG, 54,
      |   ^~~~~~~~~~~~~~~~~
In file included from /home/dev/Downloads/PhotonLibOS/net/datagram_socket.h:20,
                 from /home/dev/Downloads/PhotonLibOS/net/datagram_socket.cpp:17:
/home/dev/Downloads/PhotonLibOS/include/photon/net/socket.h:47:9: warning: ignoring packed attribute because of unpacked non-POD field ‘photon::net::IPAddr::<unnamed union> photon::net::IPAddr::<anonymous>’
   47 |         union {
      |         ^~~~~
[ 79%] Building CXX object CMakeFiles/photon_obj.dir/photon.cpp.o
/home/dev/Downloads/PhotonLibOS/include/photon/net/socket.h:155:16: warning: ignoring packed attribute because of unpacked non-POD field ‘photon::net::IPAddr photon::net::EndPoint::addr’
  155 |         IPAddr addr;
      |                ^~~~
/home/dev/Downloads/PhotonLibOS/include/photon/net/socket.h:175:36: error: static assertion failed: Endpoint size incorrect
  175 |     static_assert(sizeof(EndPoint) == 18, "Endpoint size incorrect");
      |                   ~~~~~~~~~~~~~~~~~^~~~~
/home/dev/Downloads/PhotonLibOS/include/photon/net/socket.h:175:36: note: the comparison reduces to ‘(20 == 18)’
In file included from /home/dev/Downloads/PhotonLibOS/net/datagram_socket.h:19:
/home/dev/Downloads/PhotonLibOS/include/photon/common/message.h:45:21: warning: ‘virtual ssize_t IMessage::recv(const iovec*, int, Addr*, size_t*, int)’ was hidden [-Woverloaded-virtual=]
   45 |     virtual ssize_t recv(const struct iovec* iov, int iovcnt,
      |                     ^~~~
/home/dev/Downloads/PhotonLibOS/net/datagram_socket.h:50:13: note:   by ‘photon::net::IDatagramSocket::recv(B*, S, int)’
   50 |     ssize_t recv(B* buf, S count, int flags = 0) {
      |             ^~~~
/home/dev/Downloads/PhotonLibOS/include/photon/common/message.h:35:21: warning: ‘virtual ssize_t IMessage::send(const iovec*, int, const Addr*, size_t, int)’ was hidden [-Woverloaded-virtual=]
   35 |     virtual ssize_t send(const struct iovec* iov, int iovcnt,
      |                     ^~~~
/home/dev/Downloads/PhotonLibOS/net/datagram_socket.h:46:13: note:   by ‘photon::net::IDatagramSocket::send(B*, S, int)’
   46 |     ssize_t send(B* buf, S count, int flags = 0) {
      |             ^~~~
/home/dev/Downloads/PhotonLibOS/include/photon/common/message.h:45:21: warning: ‘virtual ssize_t IMessage::recv(const iovec*, int, Addr*, size_t*, int)’ was hidden [-Woverloaded-virtual=]
   45 |     virtual ssize_t recv(const struct iovec* iov, int iovcnt,
      |                     ^~~~
/home/dev/Downloads/PhotonLibOS/net/datagram_socket.h:50:13: note:   by ‘photon::net::IDatagramSocket::recv(B*, S, int)’
   50 |     ssize_t recv(B* buf, S count, int flags = 0) {
      |             ^~~~
/home/dev/Downloads/PhotonLibOS/include/photon/common/message.h:35:21: warning: ‘virtual ssize_t IMessage::send(const iovec*, int, const Addr*, size_t, int)’ was hidden [-Woverloaded-virtual=]
   35 |     virtual ssize_t send(const struct iovec* iov, int iovcnt,
      |                     ^~~~
/home/dev/Downloads/PhotonLibOS/net/datagram_socket.h:46:13: note:   by ‘photon::net::IDatagramSocket::send(B*, S, int)’
   46 |     ssize_t send(B* buf, S count, int flags = 0) {
      |             ^~~~
/home/dev/Downloads/PhotonLibOS/include/photon/common/message.h:45:21: warning: ‘virtual ssize_t IMessage::recv(const iovec*, int, Addr*, size_t*, int)’ was hidden [-Woverloaded-virtual=]
   45 |     virtual ssize_t recv(const struct iovec* iov, int iovcnt,
      |                     ^~~~
/home/dev/Downloads/PhotonLibOS/net/datagram_socket.h:50:13: note:   by ‘photon::net::IDatagramSocket::recv(B*, S, int)’
   50 |     ssize_t recv(B* buf, S count, int flags = 0) {
      |             ^~~~
/home/dev/Downloads/PhotonLibOS/include/photon/common/message.h:35:21: warning: ‘virtual ssize_t IMessage::send(const iovec*, int, const Addr*, size_t, int)’ was hidden [-Woverloaded-virtual=]
   35 |     virtual ssize_t send(const struct iovec* iov, int iovcnt,
      |                     ^~~~
/home/dev/Downloads/PhotonLibOS/net/datagram_socket.h:46:13: note:   by ‘photon::net::IDatagramSocket::send(B*, S, int)’
   46 |     ssize_t send(B* buf, S count, int flags = 0) {
      |             ^~~~
[ 80%] Building CXX object CMakeFiles/photon_obj.dir/rpc/out-of-order-execution.cpp.o
[ 82%] Building CXX object CMakeFiles/photon_obj.dir/rpc/rpc.cpp.o
[ 84%] Building CXX object CMakeFiles/photon_obj.dir/thread/stack-allocator.cpp.o
In file included from /home/dev/Downloads/PhotonLibOS/net/basic_socket.cpp:31:
/home/dev/Downloads/PhotonLibOS/include/photon/net/socket.h:47:9: warning: ignoring packed attribute because of unpacked non-POD field ‘photon::net::IPAddr::<unnamed union> photon::net::IPAddr::<anonymous>’
   47 |         union {
      |         ^~~~~
/home/dev/Downloads/PhotonLibOS/include/photon/net/socket.h:155:16: warning: ignoring packed attribute because of unpacked non-POD field ‘photon::net::IPAddr photon::net::EndPoint::addr’
  155 |         IPAddr addr;
      |                ^~~~
/home/dev/Downloads/PhotonLibOS/include/photon/net/socket.h:175:36: error: static assertion failed: Endpoint size incorrect
  175 |     static_assert(sizeof(EndPoint) == 18, "Endpoint size incorrect");
      |                   ~~~~~~~~~~~~~~~~~^~~~~
/home/dev/Downloads/PhotonLibOS/include/photon/net/socket.h:175:36: note: the comparison reduces to ‘(20 == 18)’
[ 85%] Building CXX object CMakeFiles/photon_obj.dir/thread/thread-key.cpp.o
[ 87%] Building CXX object CMakeFiles/photon_obj.dir/thread/std-compat.cpp.o
[ 88%] Building CXX object CMakeFiles/photon_obj.dir/thread/thread-pool.cpp.o
[ 90%] Building CXX object CMakeFiles/photon_obj.dir/thread/thread.cpp.o
[ 92%] Building CXX object CMakeFiles/photon_obj.dir/thread/workerpool.cpp.o
[ 93%] Building CXX object CMakeFiles/photon_obj.dir/io/aio-wrapper.cpp.o
[ 95%] Building CXX object CMakeFiles/photon_obj.dir/io/epoll-ng.cpp.o
[ 96%] Building CXX object CMakeFiles/photon_obj.dir/io/epoll.cpp.o
In file included from /home/dev/Downloads/PhotonLibOS/net/http/body.cpp:22:
/home/dev/Downloads/PhotonLibOS/include/photon/net/socket.h:47:9: warning: ignoring packed attribute because of unpacked non-POD field ‘photon::net::IPAddr::<unnamed union> photon::net::IPAddr::<anonymous>’
   47 |         union {
      |         ^~~~~
/home/dev/Downloads/PhotonLibOS/include/photon/net/socket.h:155:16: warning: ignoring packed attribute because of unpacked non-POD field ‘photon::net::IPAddr photon::net::EndPoint::addr’
  155 |         IPAddr addr;
      |                ^~~~
In file included from /home/dev/Downloads/PhotonLibOS/include/photon/net/http/client.h:27,
                 from /home/dev/Downloads/PhotonLibOS/fs/httpfs/httpfs_v2.cpp:26:
/home/dev/Downloads/PhotonLibOS/include/photon/net/socket.h:47:9: warning: ignoring packed attribute because of unpacked non-POD field ‘photon::net::IPAddr::<unnamed union> photon::net::IPAddr::<anonymous>’
   47 |         union {
      |         ^~~~~
/home/dev/Downloads/PhotonLibOS/include/photon/net/socket.h:155:16: warning: ignoring packed attribute because of unpacked non-POD field ‘photon::net::IPAddr photon::net::EndPoint::addr’
  155 |         IPAddr addr;
      |                ^~~~
/home/dev/Downloads/PhotonLibOS/include/photon/net/socket.h:175:36: error: static assertion failed: Endpoint size incorrect
  175 |     static_assert(sizeof(EndPoint) == 18, "Endpoint size incorrect");
      |                   ~~~~~~~~~~~~~~~~~^~~~~
/home/dev/Downloads/PhotonLibOS/include/photon/net/socket.h:175:36: note: the comparison reduces to ‘(20 == 18)’
/home/dev/Downloads/PhotonLibOS/include/photon/net/socket.h:175:36: error: static assertion failed: Endpoint size incorrect
  175 |     static_assert(sizeof(EndPoint) == 18, "Endpoint size incorrect");
      |                   ~~~~~~~~~~~~~~~~~^~~~~
/home/dev/Downloads/PhotonLibOS/include/photon/net/socket.h:175:36: note: the comparison reduces to ‘(20 == 18)’
In file included from /home/dev/Downloads/PhotonLibOS/net/pooled_socket.cpp:17:
/home/dev/Downloads/PhotonLibOS/net/socket.h:47:9: warning: ignoring packed attribute because of unpacked non-POD field ‘photon::net::IPAddr::<unnamed union> photon::net::IPAddr::<anonymous>’
   47 |         union {
      |         ^~~~~
gmake[2]: *** [CMakeFiles/photon_obj.dir/build.make:524: CMakeFiles/photon_obj.dir/net/datagram_socket.cpp.o] Error 1
gmake[2]: *** Waiting for unfinished jobs....
/home/dev/Downloads/PhotonLibOS/net/socket.h:155:16: warning: ignoring packed attribute because of unpacked non-POD field ‘photon::net::IPAddr photon::net::EndPoint::addr’
  155 |         IPAddr addr;
      |                ^~~~
/home/dev/Downloads/PhotonLibOS/net/socket.h:175:36: error: static assertion failed: Endpoint size incorrect
  175 |     static_assert(sizeof(EndPoint) == 18, "Endpoint size incorrect");
      |                   ~~~~~~~~~~~~~~~~~^~~~~
/home/dev/Downloads/PhotonLibOS/net/socket.h:175:36: note: the comparison reduces to ‘(20 == 18)’
In file included from /home/dev/Downloads/PhotonLibOS/net/http/server.h:23,
                 from /home/dev/Downloads/PhotonLibOS/net/http/server.cpp:17:
/home/dev/Downloads/PhotonLibOS/include/photon/net/socket.h:47:9: warning: ignoring packed attribute because of unpacked non-POD field ‘photon::net::IPAddr::<unnamed union> photon::net::IPAddr::<anonymous>’
   47 |         union {
      |         ^~~~~
/home/dev/Downloads/PhotonLibOS/include/photon/net/socket.h:155:16: warning: ignoring packed attribute because of unpacked non-POD field ‘photon::net::IPAddr photon::net::EndPoint::addr’
  155 |         IPAddr addr;
      |                ^~~~
/home/dev/Downloads/PhotonLibOS/include/photon/net/socket.h:175:36: error: static assertion failed: Endpoint size incorrect
  175 |     static_assert(sizeof(EndPoint) == 18, "Endpoint size incorrect");
      |                   ~~~~~~~~~~~~~~~~~^~~~~
/home/dev/Downloads/PhotonLibOS/include/photon/net/socket.h:175:36: note: the comparison reduces to ‘(20 == 18)’
In file included from /home/dev/Downloads/PhotonLibOS/net/kernel_socket.cpp:17:
/home/dev/Downloads/PhotonLibOS/net/socket.h:47:9: warning: ignoring packed attribute because of unpacked non-POD field ‘photon::net::IPAddr::<unnamed union> photon::net::IPAddr::<anonymous>’
   47 |         union {
      |         ^~~~~
/home/dev/Downloads/PhotonLibOS/net/socket.h:155:16: warning: ignoring packed attribute because of unpacked non-POD field ‘photon::net::IPAddr photon::net::EndPoint::addr’
  155 |         IPAddr addr;
      |                ^~~~
/home/dev/Downloads/PhotonLibOS/net/socket.h:175:36: error: static assertion failed: Endpoint size incorrect
  175 |     static_assert(sizeof(EndPoint) == 18, "Endpoint size incorrect");
      |                   ~~~~~~~~~~~~~~~~~^~~~~
/home/dev/Downloads/PhotonLibOS/net/socket.h:175:36: note: the comparison reduces to ‘(20 == 18)’
gmake[2]: *** [CMakeFiles/photon_obj.dir/build.make:538: CMakeFiles/photon_obj.dir/net/http/body.cpp.o] Error 1
In file included from /home/dev/Downloads/PhotonLibOS/net/security-context/tls-stream.cpp:25:
/home/dev/Downloads/PhotonLibOS/include/photon/net/socket.h:47:9: warning: ignoring packed attribute because of unpacked non-POD field ‘photon::net::IPAddr::<unnamed union> photon::net::IPAddr::<anonymous>’
   47 |         union {
      |         ^~~~~
/home/dev/Downloads/PhotonLibOS/include/photon/net/socket.h:155:16: warning: ignoring packed attribute because of unpacked non-POD field ‘photon::net::IPAddr photon::net::EndPoint::addr’
  155 |         IPAddr addr;
      |                ^~~~
/home/dev/Downloads/PhotonLibOS/include/photon/net/socket.h:175:36: error: static assertion failed: Endpoint size incorrect
  175 |     static_assert(sizeof(EndPoint) == 18, "Endpoint size incorrect");
      |                   ~~~~~~~~~~~~~~~~~^~~~~
/home/dev/Downloads/PhotonLibOS/include/photon/net/socket.h:175:36: note: the comparison reduces to ‘(20 == 18)’
In file included from /home/dev/Downloads/PhotonLibOS/net/utils.h:25,
                 from /home/dev/Downloads/PhotonLibOS/net/utils.cpp:17:
/home/dev/Downloads/PhotonLibOS/include/photon/net/socket.h:47:9: warning: ignoring packed attribute because of unpacked non-POD field ‘photon::net::IPAddr::<unnamed union> photon::net::IPAddr::<anonymous>’
   47 |         union {
      |         ^~~~~
/home/dev/Downloads/PhotonLibOS/include/photon/net/socket.h:155:16: warning: ignoring packed attribute because of unpacked non-POD field ‘photon::net::IPAddr photon::net::EndPoint::addr’
  155 |         IPAddr addr;
      |                ^~~~
/home/dev/Downloads/PhotonLibOS/include/photon/net/socket.h:175:36: error: static assertion failed: Endpoint size incorrect
  175 |     static_assert(sizeof(EndPoint) == 18, "Endpoint size incorrect");
      |                   ~~~~~~~~~~~~~~~~~^~~~~
/home/dev/Downloads/PhotonLibOS/include/photon/net/socket.h:175:36: note: the comparison reduces to ‘(20 == 18)’
In file included from /home/dev/Downloads/PhotonLibOS/rpc/rpc.h:23,
                 from /home/dev/Downloads/PhotonLibOS/rpc/rpc.cpp:17:
/home/dev/Downloads/PhotonLibOS/include/photon/net/socket.h:47:9: warning: ignoring packed attribute because of unpacked non-POD field ‘photon::net::IPAddr::<unnamed union> photon::net::IPAddr::<anonymous>’
   47 |         union {
      |         ^~~~~
/home/dev/Downloads/PhotonLibOS/include/photon/net/socket.h:155:16: warning: ignoring packed attribute because of unpacked non-POD field ‘photon::net::IPAddr photon::net::EndPoint::addr’
  155 |         IPAddr addr;
      |                ^~~~
/home/dev/Downloads/PhotonLibOS/include/photon/net/socket.h:175:36: error: static assertion failed: Endpoint size incorrect
  175 |     static_assert(sizeof(EndPoint) == 18, "Endpoint size incorrect");
      |                   ~~~~~~~~~~~~~~~~~^~~~~
/home/dev/Downloads/PhotonLibOS/include/photon/net/socket.h:175:36: note: the comparison reduces to ‘(20 == 18)’
In file included from /home/dev/Downloads/PhotonLibOS/photon.cpp:29:
/home/dev/Downloads/PhotonLibOS/net/curl.h: In constructor ‘photon::net::cURL::cURL()’:
/home/dev/Downloads/PhotonLibOS/net/curl.h:243:16: warning: ‘CURLOPT_DNS_USE_GLOBAL_CACHE’ is deprecated: since 7.11.1. Use CURLOPT_SHARE [-Wdeprecated-declarations]
  243 |         setopt(CURLOPT_DNS_USE_GLOBAL_CACHE, 0L);
      |                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
gmake[2]: *** [CMakeFiles/photon_obj.dir/build.make:496: CMakeFiles/photon_obj.dir/net/basic_socket.cpp.o] Error 1
In file included from /home/dev/Downloads/PhotonLibOS/net/curl.h:19:
/usr/include/x86_64-linux-gnu/curl/curl.h:1428:3: note: declared here
 1428 |   CURLOPTDEPRECATED(CURLOPT_DNS_USE_GLOBAL_CACHE, CURLOPTTYPE_LONG, 91,
      |   ^~~~~~~~~~~~~~~~~
/home/dev/Downloads/PhotonLibOS/net/curl.h: In member function ‘long int photon::net::cURL::PUT(const char*, R*, W*, uint64_t)’:
/home/dev/Downloads/PhotonLibOS/net/curl.h:416:16: warning: ‘CURLOPT_PUT’ is deprecated: since 7.12.1. Use CURLOPT_UPLOAD [-Wdeprecated-declarations]
  416 |         setopt(CURLOPT_PUT, 1L);
      |                ^~~~~~~~~~~
/usr/include/x86_64-linux-gnu/curl/curl.h:1290:3: note: declared here
 1290 |   CURLOPTDEPRECATED(CURLOPT_PUT, CURLOPTTYPE_LONG, 54,
      |   ^~~~~~~~~~~~~~~~~
In file included from /home/dev/Downloads/PhotonLibOS/photon.cpp:30:
/home/dev/Downloads/PhotonLibOS/net/socket.h: At global scope:
/home/dev/Downloads/PhotonLibOS/net/socket.h:47:9: warning: ignoring packed attribute because of unpacked non-POD field ‘photon::net::IPAddr::<unnamed union> photon::net::IPAddr::<anonymous>’
   47 |         union {
      |         ^~~~~
/home/dev/Downloads/PhotonLibOS/net/socket.h:155:16: warning: ignoring packed attribute because of unpacked non-POD field ‘photon::net::IPAddr photon::net::EndPoint::addr’
  155 |         IPAddr addr;
      |                ^~~~
/home/dev/Downloads/PhotonLibOS/net/socket.h:175:36: error: static assertion failed: Endpoint size incorrect
  175 |     static_assert(sizeof(EndPoint) == 18, "Endpoint size incorrect");
      |                   ~~~~~~~~~~~~~~~~~^~~~~
/home/dev/Downloads/PhotonLibOS/net/socket.h:175:36: note: the comparison reduces to ‘(20 == 18)’
In file included from /home/dev/Downloads/PhotonLibOS/net/http/client.h:27,
                 from /home/dev/Downloads/PhotonLibOS/net/http/client.cpp:17:
/home/dev/Downloads/PhotonLibOS/include/photon/net/socket.h:47:9: warning: ignoring packed attribute because of unpacked non-POD field ‘photon::net::IPAddr::<unnamed union> photon::net::IPAddr::<anonymous>’
   47 |         union {
      |         ^~~~~
/home/dev/Downloads/PhotonLibOS/include/photon/net/socket.h:155:16: warning: ignoring packed attribute because of unpacked non-POD field ‘photon::net::IPAddr photon::net::EndPoint::addr’
  155 |         IPAddr addr;
      |                ^~~~
/home/dev/Downloads/PhotonLibOS/include/photon/net/socket.h:175:36: error: static assertion failed: Endpoint size incorrect
  175 |     static_assert(sizeof(EndPoint) == 18, "Endpoint size incorrect");
      |                   ~~~~~~~~~~~~~~~~~^~~~~
/home/dev/Downloads/PhotonLibOS/include/photon/net/socket.h:175:36: note: the comparison reduces to ‘(20 == 18)’
In file included from /home/dev/Downloads/PhotonLibOS/net/http/client.h:27,
                 from /home/dev/Downloads/PhotonLibOS/net/http/cookie_jar.cpp:20:
/home/dev/Downloads/PhotonLibOS/include/photon/net/socket.h:47:9: warning: ignoring packed attribute because of unpacked non-POD field ‘photon::net::IPAddr::<unnamed union> photon::net::IPAddr::<anonymous>’
   47 |         union {
      |         ^~~~~
/home/dev/Downloads/PhotonLibOS/include/photon/net/socket.h:155:16: warning: ignoring packed attribute because of unpacked non-POD field ‘photon::net::IPAddr photon::net::EndPoint::addr’
  155 |         IPAddr addr;
      |                ^~~~
/home/dev/Downloads/PhotonLibOS/include/photon/net/socket.h:175:36: error: static assertion failed: Endpoint size incorrect
  175 |     static_assert(sizeof(EndPoint) == 18, "Endpoint size incorrect");
      |                   ~~~~~~~~~~~~~~~~~^~~~~
/home/dev/Downloads/PhotonLibOS/include/photon/net/socket.h:175:36: note: the comparison reduces to ‘(20 == 18)’
In file included from /home/dev/Downloads/PhotonLibOS/net/http/message.cpp:22:
/home/dev/Downloads/PhotonLibOS/include/photon/net/socket.h:47:9: warning: ignoring packed attribute because of unpacked non-POD field ‘photon::net::IPAddr::<unnamed union> photon::net::IPAddr::<anonymous>’
   47 |         union {
      |         ^~~~~
/home/dev/Downloads/PhotonLibOS/include/photon/net/socket.h:155:16: warning: ignoring packed attribute because of unpacked non-POD field ‘photon::net::IPAddr photon::net::EndPoint::addr’
  155 |         IPAddr addr;
      |                ^~~~
/home/dev/Downloads/PhotonLibOS/include/photon/net/socket.h:175:36: error: static assertion failed: Endpoint size incorrect
  175 |     static_assert(sizeof(EndPoint) == 18, "Endpoint size incorrect");
      |                   ~~~~~~~~~~~~~~~~~^~~~~
/home/dev/Downloads/PhotonLibOS/include/photon/net/socket.h:175:36: note: the comparison reduces to ‘(20 == 18)’
gmake[2]: *** [CMakeFiles/photon_obj.dir/build.make:678: CMakeFiles/photon_obj.dir/net/security-context/tls-stream.cpp.o] Error 1
/home/dev/Downloads/PhotonLibOS/net/utils.cpp:110:8: note: offset of packed bit-field ‘photon::net::xlator::b’ has changed in GCC 4.4
  110 | struct xlator {
      |        ^~~~~~
/home/dev/Downloads/PhotonLibOS/net/utils.cpp:110:8: note: offset of packed bit-field ‘photon::net::xlator::c’ has changed in GCC 4.4
gmake[2]: *** [CMakeFiles/photon_obj.dir/build.make:664: CMakeFiles/photon_obj.dir/net/pooled_socket.cpp.o] Error 1
gmake[2]: *** [CMakeFiles/photon_obj.dir/build.make:370: CMakeFiles/photon_obj.dir/fs/httpfs/httpfs_v2.cpp.o] Error 1
gmake[2]: *** [CMakeFiles/photon_obj.dir/build.make:706: CMakeFiles/photon_obj.dir/photon.cpp.o] Error 1
gmake[2]: *** [CMakeFiles/photon_obj.dir/build.make:566: CMakeFiles/photon_obj.dir/net/http/cookie_jar.cpp.o] Error 1
gmake[2]: *** [CMakeFiles/photon_obj.dir/build.make:692: CMakeFiles/photon_obj.dir/net/utils.cpp.o] Error 1
gmake[2]: *** [CMakeFiles/photon_obj.dir/build.make:608: CMakeFiles/photon_obj.dir/net/http/server.cpp.o] Error 1
gmake[2]: *** [CMakeFiles/photon_obj.dir/build.make:650: CMakeFiles/photon_obj.dir/net/kernel_socket.cpp.o] Error 1
gmake[2]: *** [CMakeFiles/photon_obj.dir/build.make:594: CMakeFiles/photon_obj.dir/net/http/message.cpp.o] Error 1
In file included from /home/dev/Downloads/PhotonLibOS/fs/aligned-file.cpp:22:
In member function ‘size_t iovector::push_back(iovec)’,
    inlined from ‘size_t iovector::push_back(size_t)’ at /home/dev/Downloads/PhotonLibOS/include/photon/common/iovector.h:385:22,
    inlined from ‘virtual ssize_t photon::fs::AlignedFileAdaptor::preadv2_mutable(iovec*, int, off_t, int)’ at /home/dev/Downloads/PhotonLibOS/fs/aligned-file.cpp:165:38:
/home/dev/Downloads/PhotonLibOS/include/photon/common/iovector.h:372:23: warning: array subscript 65534 is outside the bounds of an interior zero-length array ‘iovec [0]’ [-Wzero-length-bounds]
  372 |         iovs[iov_end++] = iov;
      |         ~~~~~~~~~~~~~~^
/home/dev/Downloads/PhotonLibOS/include/photon/common/iovector.h: In member function ‘virtual ssize_t photon::fs::AlignedFileAdaptor::preadv2_mutable(iovec*, int, off_t, int)’:
/home/dev/Downloads/PhotonLibOS/include/photon/common/iovector.h:830:18: note: while referencing ‘iovector::iovs’
  830 |     struct iovec iovs[0];
      |                  ^~~~
In member function ‘size_t iovector::push_back(iovec)’,
    inlined from ‘size_t iovector::push_back(size_t)’ at /home/dev/Downloads/PhotonLibOS/include/photon/common/iovector.h:385:22,
    inlined from ‘virtual ssize_t photon::fs::AlignedFileAdaptor::preadv2_mutable(iovec*, int, off_t, int)’ at /home/dev/Downloads/PhotonLibOS/fs/aligned-file.cpp:165:38:
/home/dev/Downloads/PhotonLibOS/include/photon/common/iovector.h:372:23: warning: array subscript 65534 is outside the bounds of an interior zero-length array ‘iovec [0]’ [-Wzero-length-bounds]
  372 |         iovs[iov_end++] = iov;
      |         ~~~~~~~~~~~~~~^
/home/dev/Downloads/PhotonLibOS/include/photon/common/iovector.h: In member function ‘virtual ssize_t photon::fs::AlignedFileAdaptor::preadv2_mutable(iovec*, int, off_t, int)’:
/home/dev/Downloads/PhotonLibOS/include/photon/common/iovector.h:830:18: note: while referencing ‘iovector::iovs’
  830 |     struct iovec iovs[0];
      |                  ^~~~
gmake[2]: *** [CMakeFiles/photon_obj.dir/build.make:734: CMakeFiles/photon_obj.dir/rpc/rpc.cpp.o] Error 1
In member function ‘size_t iovector::push_back(iovec)’,
    inlined from ‘size_t iovector::push_back(size_t)’ at /home/dev/Downloads/PhotonLibOS/include/photon/common/iovector.h:385:22,
    inlined from ‘virtual ssize_t photon::fs::AlignedFileAdaptor::pwritev2_mutable(iovec*, int, off_t, int)’ at /home/dev/Downloads/PhotonLibOS/fs/aligned-file.cpp:207:38:
/home/dev/Downloads/PhotonLibOS/include/photon/common/iovector.h:372:23: warning: array subscript 65534 is outside the bounds of an interior zero-length array ‘iovec [0]’ [-Wzero-length-bounds]
  372 |         iovs[iov_end++] = iov;
      |         ~~~~~~~~~~~~~~^
/home/dev/Downloads/PhotonLibOS/include/photon/common/iovector.h: In member function ‘virtual ssize_t photon::fs::AlignedFileAdaptor::pwritev2_mutable(iovec*, int, off_t, int)’:
/home/dev/Downloads/PhotonLibOS/include/photon/common/iovector.h:830:18: note: while referencing ‘iovector::iovs’
  830 |     struct iovec iovs[0];
      |                  ^~~~
In member function ‘size_t iovector::push_back(iovec)’,
    inlined from ‘size_t iovector::push_back(size_t)’ at /home/dev/Downloads/PhotonLibOS/include/photon/common/iovector.h:385:22,
    inlined from ‘virtual ssize_t photon::fs::AlignedFileAdaptor::pwritev2_mutable(iovec*, int, off_t, int)’ at /home/dev/Downloads/PhotonLibOS/fs/aligned-file.cpp:207:38:
/home/dev/Downloads/PhotonLibOS/include/photon/common/iovector.h:372:23: warning: array subscript 65534 is outside the bounds of an interior zero-length array ‘iovec [0]’ [-Wzero-length-bounds]
  372 |         iovs[iov_end++] = iov;
      |         ~~~~~~~~~~~~~~^
/home/dev/Downloads/PhotonLibOS/include/photon/common/iovector.h: In member function ‘virtual ssize_t photon::fs::AlignedFileAdaptor::pwritev2_mutable(iovec*, int, off_t, int)’:
/home/dev/Downloads/PhotonLibOS/include/photon/common/iovector.h:830:18: note: while referencing ‘iovector::iovs’
  830 |     struct iovec iovs[0];
      |                  ^~~~
gmake[2]: *** [CMakeFiles/photon_obj.dir/build.make:552: CMakeFiles/photon_obj.dir/net/http/client.cpp.o] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:108: CMakeFiles/photon_obj.dir/all] Error 2
gmake: *** [Makefile:91: all] Error 2

@beef9999
Copy link
Collaborator

beef9999 commented Feb 6, 2024

That's because gcc13 has changed the way we used to write __attribute__ ((packed)). You can just remove this assertion.

@Coldwings
Copy link
Collaborator

That's because gcc13 has changed the way we used to write __attribute__ ((packed)). You can just remove this assertion.

Just add a packed attribute to the enum in IPAddr will make all those mess correct.
By ISO C++, packed struct should have every member packed, though, enum is not consider a simple member.

The static assertion is for checking memory layout at compile-time, simply remove them is not a good idea.

I will provide a fix for those stuff, including flex array in iovector and this attribute in IPAddr

@lihuiba
Copy link
Collaborator

lihuiba commented Feb 18, 2024

@rbeeli Has the issue been solved?

@rbeeli
Copy link
Author

rbeeli commented Feb 18, 2024

Hi @lihuiba
The previous issues seem to have been resolved. There seem to be new issues now on the latest main branch:

dev@dev-1-2:~/Downloads/PhotonLibOS$ cmake --build build -j
[  1%] Building CXX object third_party/CMakeFiles/easy_weak.dir/easy_weak/easy_weak.cpp.o
[  7%] Building CXX object CMakeFiles/photon_obj.dir/common/checksum/crc32c.cpp.o
[  7%] Building CXX object CMakeFiles/photon_obj.dir/common/alog.cpp.o
[  7%] Building CXX object CMakeFiles/photon_obj.dir/common/estring.cpp.o
[  7%] Building CXX object CMakeFiles/photon_obj.dir/common/executor/executor.cpp.o
[  9%] Building CXX object CMakeFiles/photon_obj.dir/common/expirecontainer.cpp.o
[ 11%] Building CXX object CMakeFiles/photon_obj.dir/common/event-loop.cpp.o
[ 12%] Building CXX object CMakeFiles/photon_obj.dir/common/identity-pool.cpp.o
[ 14%] Building CXX object third_party/CMakeFiles/fstack_weak.dir/fstack_weak/fstack_weak.cpp.o
[ 15%] Building CXX object CMakeFiles/photon_obj.dir/common/iovector.cpp.o
[ 17%] Building CXX object CMakeFiles/photon_obj.dir/common/memory-stream/memory-stream.cpp.o
[ 19%] Linking CXX static library ../output/libeasy_weak.a
[ 20%] Building CXX object CMakeFiles/photon_obj.dir/common/perf_counter.cpp.o
[ 22%] Building CXX object CMakeFiles/photon_obj.dir/common/ring.cpp.o
[ 23%] Linking CXX static library ../output/libfstack_weak.a
[ 25%] Building CXX object CMakeFiles/photon_obj.dir/common/simple_dom.cpp.o
[ 26%] Building CXX object CMakeFiles/photon_obj.dir/common/stream-messenger/messenger.cpp.o
[ 26%] Built target easy_weak
[ 28%] Building CXX object CMakeFiles/photon_obj.dir/common/stream.cpp.o
[ 30%] Building CXX object CMakeFiles/photon_obj.dir/common/utility.cpp.o
[ 31%] Building CXX object CMakeFiles/photon_obj.dir/common/uuid4.cpp.o
[ 33%] Building CXX object CMakeFiles/photon_obj.dir/fs/async_filesystem.cpp.o
[ 34%] Building CXX object CMakeFiles/photon_obj.dir/fs/aligned-file.cpp.o
[ 34%] Built target fstack_weak
[ 36%] Building CXX object CMakeFiles/photon_obj.dir/fs/exportfs.cpp.o
[ 38%] Building CXX object CMakeFiles/photon_obj.dir/fs/filecopy.cpp.o
[ 39%] Building CXX object CMakeFiles/photon_obj.dir/fs/httpfs/httpfs.cpp.o
[ 41%] Building CXX object CMakeFiles/photon_obj.dir/fs/httpfs/httpfs_v2.cpp.o
[ 42%] Building CXX object CMakeFiles/photon_obj.dir/fs/localfs.cpp.o
[ 44%] Building CXX object CMakeFiles/photon_obj.dir/fs/path.cpp.o
[ 46%] Building CXX object CMakeFiles/photon_obj.dir/fs/subfs.cpp.o
[ 47%] Building CXX object CMakeFiles/photon_obj.dir/fs/virtual-file.cpp.o
[ 49%] Building CXX object CMakeFiles/photon_obj.dir/fs/throttled-file.cpp.o
[ 50%] Building CXX object CMakeFiles/photon_obj.dir/fs/xfile.cpp.o
[ 52%] Building CXX object CMakeFiles/photon_obj.dir/io/reset_handle.cpp.o
[ 53%] Building CXX object CMakeFiles/photon_obj.dir/io/signal.cpp.o
[ 55%] Building CXX object CMakeFiles/photon_obj.dir/net/basic_socket.cpp.o
[ 57%] Building CXX object CMakeFiles/photon_obj.dir/net/curl.cpp.o
[ 58%] Building CXX object CMakeFiles/photon_obj.dir/net/http/body.cpp.o
[ 60%] Building CXX object CMakeFiles/photon_obj.dir/net/datagram_socket.cpp.o
[ 61%] Building CXX object CMakeFiles/photon_obj.dir/net/http/cookie_jar.cpp.o
[ 63%] Building CXX object CMakeFiles/photon_obj.dir/net/http/client.cpp.o
[ 65%] Building CXX object CMakeFiles/photon_obj.dir/net/http/headers.cpp.o
[ 66%] Building CXX object CMakeFiles/photon_obj.dir/net/http/server.cpp.o
[ 68%] Building CXX object CMakeFiles/photon_obj.dir/net/http/message.cpp.o
[ 69%] Building CXX object CMakeFiles/photon_obj.dir/net/http/status.cpp.o
[ 71%] Building CXX object CMakeFiles/photon_obj.dir/net/http/url.cpp.o
[ 73%] Building CXX object CMakeFiles/photon_obj.dir/net/kernel_socket.cpp.o
[ 74%] Building CXX object CMakeFiles/photon_obj.dir/net/security-context/tls-stream.cpp.o
[ 76%] Building CXX object CMakeFiles/photon_obj.dir/net/pooled_socket.cpp.o
[ 77%] Building CXX object CMakeFiles/photon_obj.dir/net/utils.cpp.o
[ 79%] Building CXX object CMakeFiles/photon_obj.dir/photon.cpp.o
[ 80%] Building CXX object CMakeFiles/photon_obj.dir/rpc/out-of-order-execution.cpp.o
[ 82%] Building CXX object CMakeFiles/photon_obj.dir/rpc/rpc.cpp.o
[ 84%] Building CXX object CMakeFiles/photon_obj.dir/thread/stack-allocator.cpp.o
[ 85%] Building CXX object CMakeFiles/photon_obj.dir/thread/std-compat.cpp.o
[ 87%] Building CXX object CMakeFiles/photon_obj.dir/thread/thread-key.cpp.o
[ 88%] Building CXX object CMakeFiles/photon_obj.dir/thread/thread-pool.cpp.o
[ 90%] Building CXX object CMakeFiles/photon_obj.dir/thread/thread.cpp.o
[ 92%] Building CXX object CMakeFiles/photon_obj.dir/thread/workerpool.cpp.o
[ 93%] Building CXX object CMakeFiles/photon_obj.dir/io/aio-wrapper.cpp.o
In file included from /home/dev/Downloads/PhotonLibOS/net/datagram_socket.h:19,
                 from /home/dev/Downloads/PhotonLibOS/net/datagram_socket.cpp:17:
/home/dev/Downloads/PhotonLibOS/include/photon/common/message.h:45:21: error: ‘virtual ssize_t IMessage::recv(const iovec*, int, Addr*, size_t*, int)’ was hidden [-Werror=overloaded-virtual=]
   45 |     virtual ssize_t recv(const struct iovec* iov, int iovcnt,
      |                     ^~~~
/home/dev/Downloads/PhotonLibOS/net/datagram_socket.h:50:13: note:   by ‘photon::net::IDatagramSocket::recv(B*, S, int)’
   50 |     ssize_t recv(B* buf, S count, int flags = 0) {
      |             ^~~~
/home/dev/Downloads/PhotonLibOS/include/photon/common/message.h:35:21: error: ‘virtual ssize_t IMessage::send(const iovec*, int, const Addr*, size_t, int)’ was hidden [-Werror=overloaded-virtual=]
   35 |     virtual ssize_t send(const struct iovec* iov, int iovcnt,
      |                     ^~~~
/home/dev/Downloads/PhotonLibOS/net/datagram_socket.h:46:13: note:   by ‘photon::net::IDatagramSocket::send(B*, S, int)’
   46 |     ssize_t send(B* buf, S count, int flags = 0) {
      |             ^~~~
/home/dev/Downloads/PhotonLibOS/include/photon/common/message.h:45:21: error: ‘virtual ssize_t IMessage::recv(const iovec*, int, Addr*, size_t*, int)’ was hidden [-Werror=overloaded-virtual=]
   45 |     virtual ssize_t recv(const struct iovec* iov, int iovcnt,
      |                     ^~~~
/home/dev/Downloads/PhotonLibOS/net/datagram_socket.h:50:13: note:   by ‘photon::net::IDatagramSocket::recv(B*, S, int)’
   50 |     ssize_t recv(B* buf, S count, int flags = 0) {
      |             ^~~~
/home/dev/Downloads/PhotonLibOS/include/photon/common/message.h:35:21: error: ‘virtual ssize_t IMessage::send(const iovec*, int, const Addr*, size_t, int)’ was hidden [-Werror=overloaded-virtual=]
   35 |     virtual ssize_t send(const struct iovec* iov, int iovcnt,
      |                     ^~~~
/home/dev/Downloads/PhotonLibOS/net/datagram_socket.h:46:13: note:   by ‘photon::net::IDatagramSocket::send(B*, S, int)’
   46 |     ssize_t send(B* buf, S count, int flags = 0) {
      |             ^~~~
/home/dev/Downloads/PhotonLibOS/include/photon/common/message.h:45:21: error: ‘virtual ssize_t IMessage::recv(const iovec*, int, Addr*, size_t*, int)’ was hidden [-Werror=overloaded-virtual=]
   45 |     virtual ssize_t recv(const struct iovec* iov, int iovcnt,
      |                     ^~~~
/home/dev/Downloads/PhotonLibOS/net/datagram_socket.h:50:13: note:   by ‘photon::net::IDatagramSocket::recv(B*, S, int)’
   50 |     ssize_t recv(B* buf, S count, int flags = 0) {
      |             ^~~~
/home/dev/Downloads/PhotonLibOS/include/photon/common/message.h:35:21: error: ‘virtual ssize_t IMessage::send(const iovec*, int, const Addr*, size_t, int)’ was hidden [-Werror=overloaded-virtual=]
   35 |     virtual ssize_t send(const struct iovec* iov, int iovcnt,
      |                     ^~~~
/home/dev/Downloads/PhotonLibOS/net/datagram_socket.h:46:13: note:   by ‘photon::net::IDatagramSocket::send(B*, S, int)’
   46 |     ssize_t send(B* buf, S count, int flags = 0) {
      |             ^~~~
In file included from /home/dev/Downloads/PhotonLibOS/fs/httpfs/httpfs.cpp:27:
/home/dev/Downloads/PhotonLibOS/fs/httpfs/../../net/curl.h: In constructor ‘photon::net::cURL::cURL()’:
/home/dev/Downloads/PhotonLibOS/fs/httpfs/../../net/curl.h:243:16: error: ‘CURLOPT_DNS_USE_GLOBAL_CACHE’ is deprecated: since 7.11.1. Use CURLOPT_SHARE [-Werror=deprecated-declarations]
  243 |         setopt(CURLOPT_DNS_USE_GLOBAL_CACHE, 0L);
      |                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /home/dev/Downloads/PhotonLibOS/fs/httpfs/../../net/curl.h:19:
/usr/include/x86_64-linux-gnu/curl/curl.h:1428:3: note: declared here
 1428 |   CURLOPTDEPRECATED(CURLOPT_DNS_USE_GLOBAL_CACHE, CURLOPTTYPE_LONG, 91,
      |   ^~~~~~~~~~~~~~~~~
/home/dev/Downloads/PhotonLibOS/fs/httpfs/../../net/curl.h: In member function ‘long int photon::net::cURL::PUT(const char*, R*, W*, uint64_t)’:
/home/dev/Downloads/PhotonLibOS/fs/httpfs/../../net/curl.h:416:16: error: ‘CURLOPT_PUT’ is deprecated: since 7.12.1. Use CURLOPT_UPLOAD [-Werror=deprecated-declarations]
  416 |         setopt(CURLOPT_PUT, 1L);
      |                ^~~~~~~~~~~
/usr/include/x86_64-linux-gnu/curl/curl.h:1290:3: note: declared here
 1290 |   CURLOPTDEPRECATED(CURLOPT_PUT, CURLOPTTYPE_LONG, 54,
      |   ^~~~~~~~~~~~~~~~~
[ 95%] Building CXX object CMakeFiles/photon_obj.dir/io/epoll.cpp.o
[ 96%] Building CXX object CMakeFiles/photon_obj.dir/io/epoll-ng.cpp.o
In file included from /home/dev/Downloads/PhotonLibOS/photon.cpp:29:
/home/dev/Downloads/PhotonLibOS/net/curl.h: In constructor ‘photon::net::cURL::cURL()’:
/home/dev/Downloads/PhotonLibOS/net/curl.h:243:16: error: ‘CURLOPT_DNS_USE_GLOBAL_CACHE’ is deprecated: since 7.11.1. Use CURLOPT_SHARE [-Werror=deprecated-declarations]
  243 |         setopt(CURLOPT_DNS_USE_GLOBAL_CACHE, 0L);
      |                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /home/dev/Downloads/PhotonLibOS/net/curl.h:19:
/usr/include/x86_64-linux-gnu/curl/curl.h:1428:3: note: declared here
 1428 |   CURLOPTDEPRECATED(CURLOPT_DNS_USE_GLOBAL_CACHE, CURLOPTTYPE_LONG, 91,
      |   ^~~~~~~~~~~~~~~~~
/home/dev/Downloads/PhotonLibOS/net/curl.h: In member function ‘long int photon::net::cURL::PUT(const char*, R*, W*, uint64_t)’:
/home/dev/Downloads/PhotonLibOS/net/curl.h:416:16: error: ‘CURLOPT_PUT’ is deprecated: since 7.12.1. Use CURLOPT_UPLOAD [-Werror=deprecated-declarations]
  416 |         setopt(CURLOPT_PUT, 1L);
      |                ^~~~~~~~~~~
/usr/include/x86_64-linux-gnu/curl/curl.h:1290:3: note: declared here
 1290 |   CURLOPTDEPRECATED(CURLOPT_PUT, CURLOPTTYPE_LONG, 54,
      |   ^~~~~~~~~~~~~~~~~
/home/dev/Downloads/PhotonLibOS/net/utils.cpp:110:8: note: offset of packed bit-field ‘photon::net::xlator::b’ has changed in GCC 4.4
  110 | struct xlator {
      |        ^~~~~~
/home/dev/Downloads/PhotonLibOS/net/utils.cpp:110:8: note: offset of packed bit-field ‘photon::net::xlator::c’ has changed in GCC 4.4
cc1plus: all warnings being treated as errors
gmake[2]: *** [CMakeFiles/photon_obj.dir/build.make:524: CMakeFiles/photon_obj.dir/net/datagram_socket.cpp.o] Error 1
gmake[2]: *** Waiting for unfinished jobs....
cc1plus: all warnings being treated as errors
gmake[2]: *** [CMakeFiles/photon_obj.dir/build.make:706: CMakeFiles/photon_obj.dir/photon.cpp.o] Error 1
cc1plus: all warnings being treated as errors
gmake[2]: *** [CMakeFiles/photon_obj.dir/build.make:356: CMakeFiles/photon_obj.dir/fs/httpfs/httpfs.cpp.o] Error 1
In file included from /home/dev/Downloads/PhotonLibOS/fs/aligned-file.cpp:22:
In member function ‘size_t iovector::push_back(iovec)’,
    inlined from ‘size_t iovector::push_back(size_t)’ at /home/dev/Downloads/PhotonLibOS/include/photon/common/iovector.h:389:22,
    inlined from ‘virtual ssize_t photon::fs::AlignedFileAdaptor::preadv2_mutable(iovec*, int, off_t, int)’ at /home/dev/Downloads/PhotonLibOS/fs/aligned-file.cpp:165:38:
/home/dev/Downloads/PhotonLibOS/include/photon/common/iovector.h:376:23: error: array subscript 65534 is outside the bounds of an interior zero-length array ‘iovec [0]’ [-Werror=zero-length-bounds]
  376 |         iovs[iov_end++] = iov;
      |         ~~~~~~~~~~~~~~^
/home/dev/Downloads/PhotonLibOS/include/photon/common/iovector.h: In member function ‘virtual ssize_t photon::fs::AlignedFileAdaptor::preadv2_mutable(iovec*, int, off_t, int)’:
/home/dev/Downloads/PhotonLibOS/include/photon/common/iovector.h:834:18: note: while referencing ‘iovector::iovs’
  834 |     struct iovec iovs[0];
      |                  ^~~~
In member function ‘size_t iovector::push_back(iovec)’,
    inlined from ‘size_t iovector::push_back(size_t)’ at /home/dev/Downloads/PhotonLibOS/include/photon/common/iovector.h:389:22,
    inlined from ‘virtual ssize_t photon::fs::AlignedFileAdaptor::preadv2_mutable(iovec*, int, off_t, int)’ at /home/dev/Downloads/PhotonLibOS/fs/aligned-file.cpp:165:38:
/home/dev/Downloads/PhotonLibOS/include/photon/common/iovector.h:376:23: error: array subscript 65534 is outside the bounds of an interior zero-length array ‘iovec [0]’ [-Werror=zero-length-bounds]
  376 |         iovs[iov_end++] = iov;
      |         ~~~~~~~~~~~~~~^
/home/dev/Downloads/PhotonLibOS/include/photon/common/iovector.h: In member function ‘virtual ssize_t photon::fs::AlignedFileAdaptor::preadv2_mutable(iovec*, int, off_t, int)’:
/home/dev/Downloads/PhotonLibOS/include/photon/common/iovector.h:834:18: note: while referencing ‘iovector::iovs’
  834 |     struct iovec iovs[0];
      |                  ^~~~
In member function ‘size_t iovector::push_back(iovec)’,
    inlined from ‘size_t iovector::push_back(size_t)’ at /home/dev/Downloads/PhotonLibOS/include/photon/common/iovector.h:389:22,
    inlined from ‘virtual ssize_t photon::fs::AlignedFileAdaptor::pwritev2_mutable(iovec*, int, off_t, int)’ at /home/dev/Downloads/PhotonLibOS/fs/aligned-file.cpp:207:38:
/home/dev/Downloads/PhotonLibOS/include/photon/common/iovector.h:376:23: error: array subscript 65534 is outside the bounds of an interior zero-length array ‘iovec [0]’ [-Werror=zero-length-bounds]
  376 |         iovs[iov_end++] = iov;
      |         ~~~~~~~~~~~~~~^
/home/dev/Downloads/PhotonLibOS/include/photon/common/iovector.h: In member function ‘virtual ssize_t photon::fs::AlignedFileAdaptor::pwritev2_mutable(iovec*, int, off_t, int)’:
/home/dev/Downloads/PhotonLibOS/include/photon/common/iovector.h:834:18: note: while referencing ‘iovector::iovs’
  834 |     struct iovec iovs[0];
      |                  ^~~~
In member function ‘size_t iovector::push_back(iovec)’,
    inlined from ‘size_t iovector::push_back(size_t)’ at /home/dev/Downloads/PhotonLibOS/include/photon/common/iovector.h:389:22,
    inlined from ‘virtual ssize_t photon::fs::AlignedFileAdaptor::pwritev2_mutable(iovec*, int, off_t, int)’ at /home/dev/Downloads/PhotonLibOS/fs/aligned-file.cpp:207:38:
/home/dev/Downloads/PhotonLibOS/include/photon/common/iovector.h:376:23: error: array subscript 65534 is outside the bounds of an interior zero-length array ‘iovec [0]’ [-Werror=zero-length-bounds]
  376 |         iovs[iov_end++] = iov;
      |         ~~~~~~~~~~~~~~^
/home/dev/Downloads/PhotonLibOS/include/photon/common/iovector.h: In member function ‘virtual ssize_t photon::fs::AlignedFileAdaptor::pwritev2_mutable(iovec*, int, off_t, int)’:
/home/dev/Downloads/PhotonLibOS/include/photon/common/iovector.h:834:18: note: while referencing ‘iovector::iovs’
  834 |     struct iovec iovs[0];
      |                  ^~~~
cc1plus: all warnings being treated as errors
gmake[2]: *** [CMakeFiles/photon_obj.dir/build.make:300: CMakeFiles/photon_obj.dir/fs/aligned-file.cpp.o] Error 1
In file included from /home/dev/Downloads/PhotonLibOS/include/photon/common/identity-pool.h:23,
                 from /home/dev/Downloads/PhotonLibOS/include/photon/common/io-alloc.h:26,
                 from /home/dev/Downloads/PhotonLibOS/include/photon/common/iovector.h:40,
                 from /home/dev/Downloads/PhotonLibOS/rpc/rpc.h:20,
                 from /home/dev/Downloads/PhotonLibOS/rpc/rpc.cpp:17:
In member function ‘void intrusive_list<NodeType>::push_back(NodeType*) [with NodeType = photon::rpc::SkeletonImpl::ThreadLink]’,
    inlined from ‘virtual int photon::rpc::SkeletonImpl::serve(IStream*)’ at /home/dev/Downloads/PhotonLibOS/rpc/rpc.cpp:328:29:
/home/dev/Downloads/PhotonLibOS/include/photon/thread/list.h:286:18: error: storing the address of local variable ‘node’ in*&this_28(D)->m_list.intrusive_list<photon::rpc::SkeletonImpl::ThreadLink>::node’ [-Werror=dangling-pointer=]
  286 |             node = ptr;
      |             ~~~~~^~~~~
/home/dev/Downloads/PhotonLibOS/rpc/rpc.cpp: In member function ‘virtual int photon::rpc::SkeletonImpl::serve(IStream*)’:
/home/dev/Downloads/PhotonLibOS/rpc/rpc.cpp:327:24: note: ‘node’ declared here
  327 |             ThreadLink node;
      |                        ^~~~
/home/dev/Downloads/PhotonLibOS/rpc/rpc.cpp:322:44: note: ‘this’ declared here
  322 |         virtual int serve(IStream* stream) override
      |                                            ^~~~~~~~
cc1plus: all warnings being treated as errors
gmake[2]: *** [CMakeFiles/photon_obj.dir/build.make:734: CMakeFiles/photon_obj.dir/rpc/rpc.cpp.o] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:108: CMakeFiles/photon_obj.dir/all] Error 2
gmake: *** [Makefile:91: all] Error 2

@lihuiba
Copy link
Collaborator

lihuiba commented Mar 28, 2024

@rbeeli I'm sorry, but I didn't notice your reply until today when I revisit the issues. I'll look at this issue toady.

@lihuiba lihuiba linked a pull request Mar 28, 2024 that will close this issue
@lihuiba
Copy link
Collaborator

lihuiba commented Mar 28, 2024

@rbeeli I have solved the issue in gcc 13. Please try it again in your environment.

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

Successfully merging a pull request may close this issue.

4 participants