Compilation warning, easy fix?

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Compilation warning, easy fix?

Rik-4
3/8/13

John,

When compiling I get this warning,

interp-core/mex.cc:2953: warning: ‘void unwind_protect::add(void
(*)(void*), void*)’ is deprecated (declared at interp-core/unwind-prot.h:51)

Would it be easy to replace line 2953 with the correct, undeprecated call?

The line in question is

  frame.add (mex::cleanup, static_cast<void *> (&context));

and the prototype for the deprecated function is

  void add (void (*fcn) (void *), void *ptr = 0) GCC_ATTR_DEPRECATED
  {
    add (new fcn_arg_elem<void *> (fcn, ptr));
  }

It would appear to be as simple as substituting the body of the deprecated
function into mex.cc, but I haven't looked into the unwind_protect class.

--Rik
Reply | Threaded
Open this post in threaded view
|

Re: Compilation warning, easy fix?

John W. Eaton
Administrator
On 03/08/2013 04:34 PM, Rik wrote:

> 3/8/13
>
> John,
>
> When compiling I get this warning,
>
> interp-core/mex.cc:2953: warning: ‘void unwind_protect::add(void
> (*)(void*), void*)’ is deprecated (declared at interp-core/unwind-prot.h:51)
>
> Would it be easy to replace line 2953 with the correct, undeprecated call?
>
> The line in question is
>
>    frame.add (mex::cleanup, static_cast<void *>  (&context));
>
> and the prototype for the deprecated function is
>
>    void add (void (*fcn) (void *), void *ptr = 0) GCC_ATTR_DEPRECATED
>    {
>      add (new fcn_arg_elem<void *>  (fcn, ptr));
>    }
>
> It would appear to be as simple as substituting the body of the deprecated
> function into mex.cc, but I haven't looked into the unwind_protect class.

I fixed it by calling add_fcn instead of add.

jwe