[asterisk-bugs] [JIRA] (ASTERISK-27630) [patch] editline: Avoid shifting a negative signed value.

Alexander Traud (JIRA) noreply at issues.asterisk.org
Sat Jan 27 08:47:49 CST 2018


Alexander Traud created ASTERISK-27630:
------------------------------------------

             Summary: [patch] editline: Avoid shifting a negative signed value.
                 Key: ASTERISK-27630
                 URL: https://issues.asterisk.org/jira/browse/ASTERISK-27630
             Project: Asterisk
          Issue Type: Bug
      Security Level: None
          Components: General
    Affects Versions: 15.2.0, 13.19.0
            Reporter: Alexander Traud
            Severity: Minor


On FreeBSD 11.1, the default compiler _clang_ (4.0.0) reports:{code}In file included from editline.c:8:
./el.c:173:21: warning: shifting a negative signed value is undefined [-Wshift-negative-value]
                        el->el_flags &= ~HANDLE_SIGNALS;
                                        ~~~~~~~~~~~~~~~
./el.h:58:25: note: expaned from macro 'HANDLE_SIGNALS'
#define HANDLE_SIGNALS  1<<0
                         ^{code}This is an external library, which is still maintained: http://thrysoee.dk/editline/

That upstream project is active, the last change happened just three weeks 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 from September 2003, which resolves the compiler issue above ([original source|http://cvsweb.netbsd.org/bsdweb.cgi/src/lib/libedit/el.h.diff?r1=1.14&r2=1.15]).

Although in Asterisk, that library has seen only 49 commits over the last 15 years, 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.



--
This message was sent by Atlassian JIRA
(v6.2#6252)



More information about the asterisk-bugs mailing list