[Top][All Lists]

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

Re: Should OCTAVE_DEPRECATED macro also apply OCTAVE_UNUSED?

From: John W. Eaton
Subject: Re: Should OCTAVE_DEPRECATED macro also apply OCTAVE_UNUSED?
Date: Fri, 2 Nov 2018 14:36:28 -0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1

On 11/02/2018 02:10 PM, Rik wrote:

I checked in a changeset to deprecate the C++ function is_hghandle in favor
of ishghandle (https://hg.savannah.gnu.org/hgweb/octave/rev/fbc23950b00a).
Where possible, it is better to have the C++ function names match the
Octave language functions so that programmers who are unfamiliar with the
core C++ code can, nevertheless, follow what the code is doing.

However, I'm now getting compilation messages that deprecated functions are
unused.  This hasn't been a problem before because the use of the
OCTAVE_DEPRECATED macro has been in .h header files, but the most recent
change takes place in a .cc file.

One possible solution is to have the OCTAVE_DEPRECATED macro also set the
attribute for unused.  Or, programmers could specifically add the
OCTAVE_UNUSED decoration to the function as well.  This works, but to my
eye seems long and klunky.  But, we also shouldn't care too much since this
code will be deleted within two versions of Octave.

OCTAVE_UNUSED OCTAVE_DEPRECATED (5.0, "use 'ishghandle' instead")

Does anyone else have an opinion on which path to take?

There's no need to mark a static function as deprecated since its scope is only inside the file where it is defined. So you can simply remove it if it is no longer needed.


reply via email to

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