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

Compilation error: cannot convert const RzPVector* {aka const rz_pvector_t*} to const RzList* {aka const rz_list_t*} in initialization #3239

Closed
1 of 3 tasks
8dcc opened this issue Aug 27, 2023 · 3 comments · Fixed by #3247
Milestone

Comments

@8dcc
Copy link
Contributor

8dcc commented Aug 27, 2023

Environment information

  • Operating System: Gentoo Linux (Kernel 5.15.80)
  • Cutter version: Latest release (v2.3.1, commit 58f6c4d)
  • Obtained from:
    • Built from source
    • Downloaded release from Cutter website or GitHub
    • Distribution repository

Describe the bug

Getting a cast error when compiling from source.

Commands used to build:

git clone https://github.com/rizinorg/cutter && cd cutter
git checkout v2.3.1
mkdir build
cmake -B build -DCUTTER_ENABLE_PYTHON=ON -DCUTTER_ENABLE_PYTHON_BINDINGS=ON -DCUTTER_ENABLE_KSYNTAXHIGHLIGHTING=ON -DCUTTER_ENABLE_GRAPHVIZ=ON -DCUTTER_EXTRA_PLUGIN_DIRS=ON -DCUTTER_USE_BUNDLED_RIZIN=OFF  
cmake --build build/

Error message after some seconds:

...
[  6%] Building CXX object src/CMakeFiles/Cutter.dir/core/Cutter.cpp.o
/home/username/cutter/src/core/Cutter.cpp: In lambda function:
/home/username/cutter/src/core/Cutter.cpp:2375:44: warning: cast between incompatible function types fromint (*)(RzDebug*)’ {akaint (*)(rz_debug_t*)’} toRzConsBreak’ {akavoid (*)(void*)’} [-Wcast-function-type]
 2375 |                         rz_cons_break_push(reinterpret_cast<RzConsBreak>(rz_debug_stop), core->dbg);
      |                                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/username/cutter/src/core/Cutter.cpp: In member functionQList<ImportDescription> CutterCore::getAllImports()’:
/home/username/cutter/src/core/Cutter.cpp:3110:54: error: cannot convertconst RzPVector*’ {akaconst rz_pvector_t*’} toconst RzList*’ {akaconst rz_list_t*’} in initialization
 3110 |     const RzList *imports = rz_bin_object_get_imports(bf->o);
      |                             ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~
      |                                                      |
      |                                                      const RzPVector* {aka const rz_pvector_t*}
gmake[2]: *** [src/CMakeFiles/Cutter.dir/build.make:383: src/CMakeFiles/Cutter.dir/core/Cutter.cpp.o] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:101: src/CMakeFiles/Cutter.dir/all] Error 2
gmake: *** [Makefile:136: all] Error 2

To Reproduce

Steps to reproduce the behavior:

  1. Clone and compile with the above commands.
  2. See error after some seconds.

Expected behavior

Successful compilation.

Additional context

Rizin v0.6.1 compiled fine (built from rizinorg/rizin, same process but with the latest commit: rizinorg/rizin@b822159 ), and rz-ghidra compiled fine as well using the rz-pm binary from the GitHub releases.

I have also been compiling rz-retdec with rz-pm for some time, and for now it doesn't seem to be any problem.

@XVilka
Copy link
Member

XVilka commented Aug 27, 2023

It's a known problem since we changed the API, and will change it even more soon: rizinorg/rizin#3775

So we didn't rush to update just yet, to pack more changes in one go. You can send a PR if you prefer to fix this right now.

@8dcc
Copy link
Contributor Author

8dcc commented Aug 27, 2023

Understood. Should I just wait for the update or compile another version?

@XVilka
Copy link
Member

XVilka commented Aug 28, 2023

Yes, you can use any commit before that one changing the API probably. Alternatively you could try to fix it yourself.

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