ANSI C++ forbids ...

Hi all. In Momentics 6.2.1 IDE, I call the wizard for a C++ template, then substitute the code with sample resource manager “/dev/null” from rk’s book. After customizing the open function, for instance:

int io_open (resmgr_context_t *ctp, io_open_t *msg,RESMGR_HANDLE_T *handle, void *extra){
std::cout << “In the io_open” << std::endl;
return (iofunc_open_default (ctp, msg, handle, extra)); }

I get the compiler error "ANSI C++ forbids implicit conversion from `void ’ in argument passing". I know I can lower error level to warning, flagging by “-fpermissive” in common.mk and have it compile; yet I guess it’s possible to explicitly cast the argument to the effective type. I tried a few cast ‘styles’, (and extern “C” {#include <sys/iofunc.h> } etc.), but I’m always wrong and/or missing something. Can someone show me an example of the cast sintax needed to have C++ “digest” C’s (void)argument? Thank you.
stefano

Have you tried casting handle pointer like this ?

iofunc_open_default (ctp, msg, (iofunc_attr_t *)handle, extra)

thank you very much mezek, I actually was (wrongly) paying attention only to the fourth argument, (void *) extra.

stefano