[Home]

Summary:ASTERISK-27559: [patch] editline: Avoid comparison between pointer and zero character constant.
Reporter:Alexander Traud (traud)Labels:patch
Date Opened:2018-01-06 06:41:32.000-0600Date Closed:2018-01-08 06:09:22.000-0600
Priority:MinorRegression?
Status:Closed/CompleteComponents:General
Versions:13.18.5 15.1.5 Frequency of
Occurrence
Related
Issues:
is related toASTERISK-27630 [patch] editline: Avoid shifting a negative signed value.
Environment:Attachments:( 0) gcc_editline.patch
Description:The compiler GCC (7.2) reports:{code}In file included from editline.c:18:0:
term.c: In function 'term_alloc':
term.c:431:28: warning: comparison between pointer and zero character constant [-Wpointer-compare]
  if (*tmp != NULL && *tmp != '\0' && *tmp != *str) {
                           ^~
term.c:431:23: note: did you mean to dereference the pointer?{code}This is an external library, which is still maintained: http://thrysoee.dk/editline/

That upstream project is active, the last change happened just four days ago (officially it is called libedit 2.11). The copy within Asterisk is from 2002, libedit 2.6.

The short-term workaround is to use the precompiled libedit of your Unix distribution, for example in Debian/Ubuntu: {{sudo apt install libedit-dev}}. As mid-term solution, I attached/backported the change which resolves the compiler issue above ([original source|http://cvsweb.netbsd.org/bsdweb.cgi/src/lib/libedit/terminal.c.diff?r1=1.22&r2=1.24]).

Although that library has seen only 49 commits over the last 15 years in Asterisk, as long-term approach, that external library should be
A) updated to the latest upstream version. Or
B) removed and relied solely on precompiled Unix packages, see ASTERISK-18725.
Comments:By: Friendly Automation (friendly-automation) 2018-01-08 05:54:06.484-0600

Change 7857 merged by Jenkins2:
editline: Avoid comparison between pointer and zero character constant.

[https://gerrit.asterisk.org/7857|https://gerrit.asterisk.org/7857]

By: Friendly Automation (friendly-automation) 2018-01-08 06:09:23.736-0600

Change 7858 merged by Jenkins2:
editline: Avoid comparison between pointer and zero character constant.

[https://gerrit.asterisk.org/7858|https://gerrit.asterisk.org/7858]

By: Friendly Automation (friendly-automation) 2018-01-08 06:14:43.757-0600

Change 7856 merged by Jenkins2:
editline: Avoid comparison between pointer and zero character constant.

[https://gerrit.asterisk.org/7856|https://gerrit.asterisk.org/7856]