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

[22.14.0] fails to build with libxml2 2.12.9 & GCC 14 (due to -Werror) #855

Closed
tgurr opened this issue Dec 4, 2024 · 0 comments · Fixed by #857
Closed

[22.14.0] fails to build with libxml2 2.12.9 & GCC 14 (due to -Werror) #855

tgurr opened this issue Dec 4, 2024 · 0 comments · Fixed by #857
Assignees
Labels

Comments

@tgurr
Copy link
Contributor

tgurr commented Dec 4, 2024

Expected behavior

Do not fail to build.

Actual behavior

[ 70%] Building C object util/CMakeFiles/gvm_util_shared.dir/xmlutils.c.o
cd /var/tmp/paludis/build/net-analyzer-gvm-libs-22.14.0/work/build/util && /usr/bin/x86_64-pc-linux-gnu-cc -DGVM_LIBS_VERSION=\"22.14.0\" -DHAVE_MQTT=1 -DREDIS_SOCKET_PATH=\"/tmp/redis.sock\" -Dgvm_util_shared_EXPORTS -I/usr/x86_64-pc-linux-gnu/include/glib-2.0 -I/usr/x86_64-pc-linux-gnu/lib/glib-2.0/include -I/usr/x86_64-pc-linux-gnu/include/libxml2 -march=native -O2 -pipe      -std=c11     -Wall     -Wextra     -Werror     -Wpedantic     -Wmissing-prototypes     -Wshadow     -Wsequence-point     -D_ISOC11_SOURCE     -D_DEFAULT_SOURCE -O3 -DNDEBUG -Wformat -Wformat-security -D_FORTIFY_SOURCE=2 -fstack-protector  -std=gnu11 -fPIC -fdiagnostics-color=always -MD -MT util/CMakeFiles/gvm_util_shared.dir/xmlutils.c.o -MF CMakeFiles/gvm_util_shared.dir/xmlutils.c.o.d -o CMakeFiles/gvm_util_shared.dir/xmlutils.c.o -c /var/tmp/paludis/build/net-analyzer-gvm-libs-22.14.0/work/gvm-libs-22.14.0/util/xmlutils.c
/var/tmp/paludis/build/net-analyzer-gvm-libs-22.14.0/work/gvm-libs-22.14.0/util/xmlutils.c: In function 'xml_file_iterator_next':
/var/tmp/paludis/build/net-analyzer-gvm-libs-22.14.0/work/gvm-libs-22.14.0/util/xmlutils.c:3034:29: error: assignment discards 'const' qualifier from pointer target type [-Werror=discarded-qualifiers]
 3034 |                   xml_error = xmlCtxtGetLastError (iterator->parser_ctxt);
      |

Steps to reproduce

  1. have libxml2 2.12.9 installed
  2. use GCC 14
  3. try to build gvm-libs 22.14.0

GVM versions

Environment

Operating system: Exherbo Linux

Installation method / source: packages (source-based distribution)

Logfiles

Complete build log: gvm-libs-22.14.0_build.log

Additional notes

Removing -Werror with e.g. sed -e '/-Werror/d' -i CMakeLists.txt as a workaround allows the build to succeed, maybe think about adding a CMake toggle for it as often seen in other projects (-DENABLE_WERROR) or something alike.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants