|
Re: iofunc_open_default - passing void* as argument in C++
|
04/23/2008 4:17 PM
post7225
|
Re: iofunc_open_default - passing void* as argument in C++
How are you compiling ( flags ). I'm getting a diifferent error then you. RESMGR_HANDLE_t is by default equal to (void
*). Thus handle will generate the warning and must be cast to (iofunc_attr_t*)
> Hello people!
>
> This is my first post, and am excited about participating in the QNX community
> .
>
> I'm attempting to write a resource manager in C++, and I was given a mickey-
> mouse example program so I could learn how to write one. In this program, I
> have an io_open() function that will be called every time an open() request
> comes in. Here is the code for the function:
>
> int io_open( resmgr_context_t *ctp, io_open_t *msg,
> RESMGR_HANDLE_T *handle, void *extra )
> {
> int returnVal = 0;
>
> printf("Some debug message\n")
>
> returnVal = iofunc_open_default( ctp, msg, handle, extra );
>
> return ( returnVal );
> }
>
> The prototype for iofunc_open_default() is as follows (in sys/iofunc.h):
>
> int iofunc_open_default( resmgr_context_t *ctp, io_open_t *msg,
> iofunc_attr_t *attr, void *extra );
>
> When I attempt to compile, I get the following error message in reference to
> the 'void *extra' parameter argument:
>
> "ANSI C++ forbids implicit conversion from `void *' in argument passing"
>
> So my question is, do I need to explicitly compile my resource manager in C?
> Or is there a way I can pass in (void *) to the iofunc_open_default() in C++?
> It seems to me there should be a way, otherwise C++ should also complain that
> there is a (void *) parameter in the argument list.
>
> If this is the wrong forum, I ask for mercy and to be redirected to the proper
> forum.
>
> Thanks!
>
> ~Anthony
>
|
|
|