obsolete functions found during the build process

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

obsolete functions found during the build process

Jean-Christophe Helary
There are plenty of warnings during the build process about obsolete functions "as of 2n.n".

For ex:

In nnmh-request-list-1:
gnus/nnmh.el:245:14:Warning: ‘string-to-multibyte’ is an obsolete function (as
    of 26.1); use ‘decode-coding-string’.

Is there anything to be done about that ?

Jean-Christophe
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: obsolete functions found during the build process

Eli Zaretskii
> From: Jean-Christophe Helary <[hidden email]>
> Date: Sat, 12 Aug 2017 09:42:33 +0200
>
> In nnmh-request-list-1:
> gnus/nnmh.el:245:14:Warning: ‘string-to-multibyte’ is an obsolete function (as
>     of 26.1); use ‘decode-coding-string’.
>
> Is there anything to be done about that ?

In general, replace the obsolete functions as the warning suggests.
In some cases, the use of the obsolete function is justified, though.

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: obsolete functions found during the build process

Jean-Christophe Helary
Thank you Eli.

Jean-Christophe

> On Aug 12, 2017, at 10:45, Eli Zaretskii <[hidden email]> wrote:
>
>> From: Jean-Christophe Helary <[hidden email]>
>> Date: Sat, 12 Aug 2017 09:42:33 +0200
>>
>> In nnmh-request-list-1:
>> gnus/nnmh.el:245:14:Warning: ‘string-to-multibyte’ is an obsolete function (as
>>    of 26.1); use ‘decode-coding-string’.
>>
>> Is there anything to be done about that ?
>
> In general, replace the obsolete functions as the warning suggests.
> In some cases, the use of the obsolete function is justified, though.


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: obsolete functions found during the build process

Paul Eggert
In reply to this post by Eli Zaretskii
Eli Zaretskii wrote:
> In some cases, the use of the obsolete function is justified, though.


Is there some way for code to say "I know this function is obsolete, but the
call is justified so don't warn about it"? That would be helpful, so that
compiles could be clean and so that people would be more likely to pay attention
to any stray warnings that do crop up.

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: obsolete functions found during the build process

Eric Abrahamsen-2
Paul Eggert <[hidden email]> writes:

> Eli Zaretskii wrote:
>> In some cases, the use of the obsolete function is justified, though.
>
>
> Is there some way for code to say "I know this function is obsolete,
> but the call is justified so don't warn about it"? That would be
> helpful, so that compiles could be clean and so that people would be
> more likely to pay attention to any stray warnings that do crop up.

Maybe the `with-no-warnings' macro?

Eric


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: obsolete functions found during the build process

Stefan Monnier
In reply to this post by Eli Zaretskii
> In general, replace the obsolete functions as the warning suggests.
> In some cases, the use of the obsolete function is justified, though.

AFAICT, there are indeed cases where using decode-coding-string instead
of string-to-multibyte is not really an option, but that means
"obsolete" is not really a good description.

Using with-no-warnings to mask obsolescence warnings is OK when we know
that the code is only kept for backward compatibility, but when there is
no good replacement, it's not a good solution.

So we should strive to provide valid alternatives for every use of
string-to-multibyte (or de-obsolete it, tho it's not my favorite solution).


        Stefan


Loading...