You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
GCC 13 build fails due to multiple: warning: 'template<long unsigned int _Len, long unsigned int _Align> struct std::aligned_storage' is deprecated [-Wdeprecated-declarations]
#418
Closed
eitlane opened this issue
Mar 24, 2023
· 5 comments
Compiling jsoncons 0.170.0 with gcc 13 (x86_64, linux, build from 12 March commit: f23dc726875c26f2c38dfded453aa9beba0b9be9) build fails with multiple errors like:
/include/jsoncons/detail/string_wrapper.hpp:101:31: warning: 'template<long unsigned int _Len, long unsigned int _Align> struct std::aligned_storage' is deprecated [-Wdeprecated-declarations]
typedef typename std::aligned_storage<sizeof(storage_t), alignof(storage_t)>::type json_storage_kind;
^~~~~~~~~~~~~~~
In file included from /include/c++/13.0.1/bits/char_traits.h:50,
from /include/c++/13.0.1/string:42,
from /jsoncons-0.170.0/include/jsoncons/basic_json.hpp:11:
/include/c++/13.0.1/type_traits:2099:5: note: declared here
aligned_storage
^~~~~~~~~~~~~~~
Once I removed -Werror from the cmake file, the project compiled successfully.
Thanks
V
The text was updated successfully, but these errors were encountered:
Thanks for reporting this. Yes, C++23 is deprecating std::aligned_storage, which jsoncons uses for a structure for storing string data, because std::aligned_* suffers from many poor API design decisions. We'll be investigating a replacement for the next release.
Thanks a lot for the fast response. I wish everybody responds as fast as you :)
I applied the patch on my side but it still fails (much further though - 76% instead of 6%)
Here is the error:
[ 76%] Building CXX object test/CMakeFiles/unit_tests.dir/corelib/src/json_storage_tests.cpp.o
In file included from jsoncons-0.170.0/test/corelib/src/json_reader_tests.cpp:7:
jsoncons-0.170.0/test/corelib/src/freelist_allocator.hpp:20:23: error: 'template<long unsigned int _Len, long unsigned int _Align> struct std::aligned_storage' is deprecated [-Werror=deprecated-declarations]
20 | typename std::aligned_storage<sizeof(T), alignof(T)>::type storage;
| ^~~~~~~~~~~~~~~
In file included from include/c++/13.0.1/bits/char_traits.h:50,
from include/c++/13.0.1/string:42,
from jsoncons-0.170.0/include/jsoncons/basic_json.hpp:11,
from jsoncons-0.170.0/include/jsoncons/json.hpp:10,
from jsoncons-0.170.0/test/corelib/src/json_reader_tests.cpp:4:
include/c++/13.0.1/type_traits:2099:5: note: declared here
2099 | aligned_storage
| ^~~~~~~~~~~~~~~
You're right, I fixed the one in the jsoncons library, but there were a couple of additional ones in the test code, and one in the third party catch.hpp header. I updated to the latest catch.hpp, which fixed its issue, and fixed the rest. Fixes are on master.
Hi all,
Compiling jsoncons 0.170.0 with gcc 13 (x86_64, linux, build from 12 March commit: f23dc726875c26f2c38dfded453aa9beba0b9be9) build fails with multiple errors like:
Once I removed -Werror from the cmake file, the project compiled successfully.
Thanks
V
The text was updated successfully, but these errors were encountered: