ZDoom / Raze

Build engine port backed by GZDoom tech. Currently supports Duke Nukem 3D, Blood, Shadow Warrior, Redneck Rampage and Powerslave/Exhumed.
664 stars 59 forks source link

[BUG] [General] Raze fails to compile on Fedora 40 - GCC 14.0.1 #1087

Closed JoshuaPettus closed 2 months ago

JoshuaPettus commented 2 months ago

Raze version

No response

Which game are you running with Raze?

Other

What Operating System are you using?

Linux x86_64

Please describe your specific OS version

Fedora 40

Relevant hardware info

No response

Have you checked that no other similar issue already exists?

A clear and concise description of what the bug is.

Looks definitely to be a compiler issue. When attempting to compile, gcc trips up here:

`[ 44%] Building C object libraries/webp/CMakeFiles/webp.dir/src/utils/huffman_utils.c.o /home/joshuapettus/Downloads/Raze-1.10.1/libraries/ZWidget/src/widgets/lineedit/lineedit.cpp: In member function ‘virtual void LineEdit::OnKeyDown(EInputKey)’: /home/joshuapettus/Downloads/Raze-1.10.1/libraries/ZWidget/src/widgets/lineedit/lineedit.cpp:509:76: error: cannot convert ‘std::__cxx11::basic_string::iterator’ to ‘const char*’ 509 std::string::const_iterator end_str = std::remove(str.begin(), str.end(), '\n'); ~~~~~^~
std::__cxx11::basic_string::iterator
In file included from /usr/include/c++/14/cstdio:42, from /usr/include/c++/14/ext/string_conversions.h:45, from /usr/include/c++/14/bits/basic_string.h:4154, from /usr/include/c++/14/string:54, from /home/joshuapettus/Downloads/Raze-1.10.1/libraries/ZWidget/include/zwidget/widgets/lineedit/../../core/widget.h:3, from /home/joshuapettus/Downloads/Raze-1.10.1/libraries/ZWidget/include/zwidget/widgets/lineedit/lineedit.h:4, from /home/joshuapettus/Downloads/Raze-1.10.1/libraries/ZWidget/src/widgets/lineedit/lineedit.cpp:2: /usr/include/stdio.h:158:32: note: initializing argument 1 of ‘int remove(const char*)’ 158 extern int remove (const char *filename) THROW; ~~^~~~ /home/joshuapettus/Downloads/Raze-1.10.1/libraries/ZWidget/src/widgets/lineedit/lineedit.cpp:511:48: error: cannot convert ‘std::__cxx11::basic_string::iterator’ to ‘const char*’ 511 end_str = std::remove(str.begin(), str.end(), '\r'); ~~~~~^~
std::__cxx11::basic_string::iterator

/usr/include/stdio.h:158:32: note: initializing argument 1 of ‘int remove(const char)’ 158 | extern int remove (const char filename) THROW; | ~~^~~~ make[2]: [libraries/ZWidget/CMakeFiles/zwidget.dir/build.make:230: libraries/ZWidget/CMakeFiles/zwidget.dir/src/widgets/lineedit/lineedit.cpp.o] Error 1 make[1]: [CMakeFiles/Makefile2:370: libraries/ZWidget/CMakeFiles/zwidget.dir/all] Error 2 make[1]: *** Waiting for unfinished jobs.... `

Steps to reproduce the behaviour.

Explain how to reproduce

Your configuration

No response

Provide a Log

No response

madame-rachelle commented 2 months ago

This was reported on GZDoom and had an easy fix. Unfortunately I am shooting in the dark but I don't have much choice - and as far as I am concerned the GCC committee are the ones at fault for introducing such a breaking change.

Addressed with this change - https://github.com/ZDoom/Raze/commit/f3cad8426cd808be5ded036ed12a497d27d3742e

JoshuaPettus commented 2 months ago

Unfortunately that seems to be par for the course with them...