atos-tools / qemu

QEMU with instrumentation support, ref to tcg/plugins/README
https://guillon.github.io/qemu-plugins
Other
5 stars 8 forks source link

fix build on GCC13 #20

Closed NicolasDerumigny closed 1 year ago

NicolasDerumigny commented 1 year ago

Building with GCC13.1.1 does not finish and crashed with error:

../../../../../submodules/qemu/tcg/plugins/cpp/coverage.cpp: In member function ‘void plugin_coverage::dump_symbol_coverage(symbol&, std::unordered_map<long unsigned int, long unsigned int>&)’:
../../../../../submodules/qemu/tcg/plugins/cpp/coverage.cpp:77:32: error: possibly dangling reference to a temporary [-Werror=dangling-reference]
   77 |             const instruction& i = get_instruction(i_pc, std::move(cs_inst));
      |                                ^
../../../../../submodules/qemu/tcg/plugins/cpp/coverage.cpp:77:51: note: the temporary was destroyed at the end of the full expression ‘plugin::get_instruction(i_pc, std::unique_ptr<cs_insn, void (*)(cs_insn*)>((* & std::move<unique_ptr<cs_insn, void (*)(cs_insn*)>&>(cs_inst))))’
   77 |             const instruction& i = get_instruction(i_pc, std::move(cs_inst));
      |                                    ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
cc1plus: all warnings being treated as errors
ninja: build stopped: subcommand failed.

This fixes the issue.

github-actions[bot] commented 1 year ago

Thank you for your interest in the QEMU project.

This repository is a read-only mirror of the project's repostories hosted on https://gitlab.com/qemu-project/qemu.git. The project does not process merge requests filed on GitHub.

QEMU welcomes contributions of code (either fixing bugs or adding new functionality). However, we get a lot of patches, and so we have some guidelines about contributing on the project website: https://www.qemu.org/contribute/