Closed nrz closed 7 months ago
Building dining philosophers fails with these errors: https://github.com/nrz/ylikuutio/actions/runs/8672917103/job/23783717226
In file included from /home/runner/work/ylikuutio/ylikuutio/code/thread_test/dining_philosophers.cpp:18:
/usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/chrono:2320:48: error: call to consteval function 'std::chrono::hh_mm_ss::_S_fractional_width' is not a constant expression
static constexpr unsigned fractional_width = {_S_fractional_width()};
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/chrono:2320:48: note: undefined function '_S_fractional_width' cannot be used in a constant expression
/usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/chrono:2275:2: note: declared here
_S_fractional_width()
^
1 error generated.
gmake[2]: *** [CMakeFiles/dining_philosophers.dir/build.make:76: CMakeFiles/dining_philosophers.dir/code/thread_test/dining_philosophers.cpp.o] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:579: CMakeFiles/dining_philosophers.dir/all] Error 2
gmake: *** [Makefile:146: all] Error 2
Error: Process completed with exit code 2.
Fixed by e988d6d597b734d67ef84b3fd17a7948db610b4c and e3f280c79212b75f525844b18569c739511fb4f4 .
Fix GitHub Actions GNU/Linux build on Clang