I am following the bbdynsize tutorial:
https://dynamorio.org/API_tutorial_bbdynsize4.html
DynamoRIO version: DynamoRIO-Linux-9.93.19503
OS: Ubuntu x86_64 GNU/Linux
When I build it I get the following error:
bb_size_client.cpp:81:62: error: invalid conversion from ‘void (*)(uint)’ {aka ‘void (*)(unsigned int)’} to ‘void*’ [-fpermissive]
81 | dr_insert_clean_call(drcontext, bb, instrlist_first(bb), clean_call, false, 1, OPND_CREATE_INT32(num_instructions));
| ^~~~~~~~~~
| |
| void (*)(uint) {aka void (*)(unsigned int)}
Should there be a cast to (void *) or am I getting it wrong:
- dr_insert_clean_call(drcontext, bb, instrlist_first(bb), clean_call, false, 1, OPND_CREATE_INT32(num_instructions));
+ dr_insert_clean_call(drcontext, bb, instrlist_first(bb), (void *)clean_call, false, 1, OPND_CREATE_INT32(num_instructions))