Hi,
when compiling cxxtools-3.0 on rawhide it fails with the following error messages [2]:
settingswriter.cpp:42:26: required from here /usr/include/c++/11/string_view:98:21: error: static assertion failed 98 | static_assert(is_trivial_v<_CharT> && is_standard_layout_v<_CharT>); | ^~~~~~~~~~~~~~~~~~~~ /usr/include/c++/11/string_view:98:21: note: 'std::is_trivial_vcxxtools::Char' evaluates to false make[2]: *** [Makefile:920: settingswriter.lo] Error 1 make[2]: *** Waiting for unfinished jobs.... make[2]: Leaving directory '/builddir/build/BUILD/cxxtools-3.0/src' make[1]: *** [Makefile:600: all] Error 2 make[1]: Leaving directory '/builddir/build/BUILD/cxxtools-3.0/src' make: *** [Makefile:539: all-recursive] Error 1 error: Bad exit status from /var/tmp/rpm-tmp.TZ5CHP (%build) RPM build errors:
[1] https://martinkg.fedorapeople.org/ErrorReports/cxxtools-3.0-1.fc33.src.rpm [2] https://koji.fedoraproject.org/koji/taskinfo?taskID=60083999
How can i solve it ?
Regards Martin
On 20/01/21 09:51 -0000, Martin Gansser wrote:
Hi,
when compiling cxxtools-3.0 on rawhide it fails with the following error messages [2]:
settingswriter.cpp:42:26: required from here /usr/include/c++/11/string_view:98:21: error: static assertion failed 98 | static_assert(is_trivial_v<_CharT> && is_standard_layout_v<_CharT>); | ^~~~~~~~~~~~~~~~~~~~ /usr/include/c++/11/string_view:98:21: note: 'std::is_trivial_vcxxtools::Char' evaluates to false make[2]: *** [Makefile:920: settingswriter.lo] Error 1 make[2]: *** Waiting for unfinished jobs.... make[2]: Leaving directory '/builddir/build/BUILD/cxxtools-3.0/src' make[1]: *** [Makefile:600: all] Error 2 make[1]: Leaving directory '/builddir/build/BUILD/cxxtools-3.0/src' make: *** [Makefile:539: all-recursive] Error 1 error: Bad exit status from /var/tmp/rpm-tmp.TZ5CHP (%build) RPM build errors:
[1] https://martinkg.fedorapeople.org/ErrorReports/cxxtools-3.0-1.fc33.src.rpm [2] https://koji.fedoraproject.org/koji/taskinfo?taskID=60083999
How can i solve it ?
The code is invalid. std::string and std::string_view are for manipulating sequences of types which are trivial and standard layout. The cxxtools::Char type is non-trivial, probably because it has a user-provided copy constructor or destructor. You can't use a std::string_view of such types.
The code needs to be fixed.
On 20/01/21 10:47 +0000, Jonathan Wakely wrote:
On 20/01/21 09:51 -0000, Martin Gansser wrote:
Hi,
when compiling cxxtools-3.0 on rawhide it fails with the following error messages [2]:
settingswriter.cpp:42:26: required from here /usr/include/c++/11/string_view:98:21: error: static assertion failed 98 | static_assert(is_trivial_v<_CharT> && is_standard_layout_v<_CharT>); | ^~~~~~~~~~~~~~~~~~~~ /usr/include/c++/11/string_view:98:21: note: 'std::is_trivial_vcxxtools::Char' evaluates to false make[2]: *** [Makefile:920: settingswriter.lo] Error 1 make[2]: *** Waiting for unfinished jobs.... make[2]: Leaving directory '/builddir/build/BUILD/cxxtools-3.0/src' make[1]: *** [Makefile:600: all] Error 2 make[1]: Leaving directory '/builddir/build/BUILD/cxxtools-3.0/src' make: *** [Makefile:539: all-recursive] Error 1 error: Bad exit status from /var/tmp/rpm-tmp.TZ5CHP (%build) RPM build errors:
[1] https://martinkg.fedorapeople.org/ErrorReports/cxxtools-3.0-1.fc33.src.rpm [2] https://koji.fedoraproject.org/koji/taskinfo?taskID=60083999
How can i solve it ?
The code is invalid. std::string and std::string_view are for manipulating sequences of types which are trivial and standard layout. The cxxtools::Char type is non-trivial, probably because it has a user-provided copy constructor or destructor. You can't use a std::string_view of such types.
It's non-trivial because it has a non-trivial default constructor:
//! Constructs a character with a value of 0. Char() : _value(0) {}
The code needs to be fixed.
ok, i think i will contac upstream to fix it.
Regards Martin
issue was fixed now, with this patch:
--- include/cxxtools/char.h.orig 2021-01-28 08:34:49.182956317 +0100 +++ include/cxxtools/char.h 2021-01-28 08:35:41.524954646 +0100 @@ -68,9 +68,7 @@ typedef int32_t value_type;
//! Constructs a character with a value of 0. - Char() - : _value(0) - {} + Char() = default;
//! Constructs a character using the given value as base for the character value. Char(value_type ch)