octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #61784] builtins deprecated warning problem


From: Markus Mützel
Subject: [Octave-bug-tracker] [bug #61784] builtins deprecated warning problem
Date: Wed, 12 Jan 2022 12:41:23 -0500 (EST)
User-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36 Edg/97.0.1072.55

Update of bug #61784 (project octave):

                  Status:                    None => Confirmed              

    _______________________________________________________

Follow-up Comment #3:

Aah, thanks for the updated reproducer.
I can confirm this issue. The error for me is:

>> mkoctfile lpath.cc
lpath.cc: In function 'octave_value_list Flpath(const octave_value_list&,
int)':
lpath.cc:12:20: error: call of overloaded
'F__dump_load_path__(octave::interpreter&)' is ambiguous
   12 | F__dump_load_path__(interp);
      | ~~~~~~~~~~~~~~~~~~~^~~~~~~~
In file included from lpath.cc:3:
c:\progra~1\gnuoct~1\octave~1.90\mingw64\include\octave-7.0.90\octave\builtin-defun-decls.h:2530:1:
note: candidate: 'octave_value_list F__dump_load_path__(octave::inte
rpreter&, const octave_value_list&, int)'
 2530 | F__dump_load_path__ (octave::interpreter& interp, const
octave_value_list& args = octave_value_list (), int nargout = 0)
      | ^~~~~~~~~~~~~~~~~~~
In file included from lpath.cc:3:
c:\progra~1\gnuoct~1\octave~1.90\mingw64\include\octave-7.0.90\octave\builtin-defun-decls.h:53:1:
note: candidate: 'octave_value_list octave::F__dump_load_path__(octave
::interpreter&, const octave_value_list&, int)'
   53 | F__dump_load_path__ (octave::interpreter&, const octave_value_list& =
octave_value_list (), int = 0);
      | ^~~~~~~~~~~~~~~~~~~
error: mkoctfile: building exited with failure status


The error can be avoided, e.g., by moving the entire function into the octave
namespace:

#include <octave/oct.h>
#include <octave/interpreter.h>
#include <octave/builtin-defun-decls.h>

namespace octave
{
DEFUN_DLD (lpath, args, nargout,
"Hello World Help String")
{
octave::interpreter& interp = *octave::interpreter::the_interpreter ();

F__dump_load_path__(interp);

return octave_value_list ();
}
}


Or by explicitly calling the function in the octave namespace:

#include <octave/oct.h>
#include <octave/interpreter.h>
#include <octave/builtin-defun-decls.h>

DEFUN_DLD (lpath, args, nargout,
"Hello World Help String")
{
octave::interpreter& interp = *octave::interpreter::the_interpreter ();

octave::F__dump_load_path__(interp);

return octave_value_list ();
}


But I'd guess the intention was that the deprecated function wrapper used in
the original example should be working, too.

We probably don't want to remove the original functions (without namespace)
without any grace period.
I don't know if we like to use the work-around with the template.

CC'ing jwe.


    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?61784>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]