Review Board 1.7.16


clang compiler warning: -Wpointer-bool-conversion

Review Request #4541 - Created March 27, 2015 and submitted

Diederik de Groot
13
ASTERISK-24917
Reviewers
asterisk-dev
Asterisk
clang's static analyzer will throw quite a number warnings / errors during compilation, some of which can be very helpfull in finding corner-case bugs.

clang compiler warning:-Wpointer-bool-conversion

Issues:
chan_pjsip.c:1898:13: warning: address of array 'data->text' will always evaluate to 'true' [-Wpointer-bool-conversion]
        if (!data->text) {
            ~~~~~~~^~~~
app_minivm.c:1841:18: warning: address of array 'etemplate->locale' will always evaluate to 'true' [-Wpointer-bool-conversion]
                if (etemplate->locale) {
                ~~  ~~~~~~~~~~~^~~~~~
app_minivm.c:1871:17: warning: address of array 'etemplate->locale' will always evaluate to 'true' [-Wpointer-bool-conversion]
        if (etemplate->locale) {
        ~~  ~~~~~~~~~~~^~~~~~
app_queue.c:6686:19: warning: address of array 'qe->parent->monfmt' will always evaluate to 'true' [-Wpointer-bool-conversion]
                if (qe->parent->monfmt && *qe->parent->monfmt) {
                    ~~~~~~~~~~~~^~~~~~ ~~
app_queue.c:9090:15: warning: address of array 'mem->state_interface' will always evaluate to 'true' [-Wpointer-bool-conversion]
                                        if (mem->state_interface) {
                                        ~~  ~~~~~^~~~~~~~~~~~~~~
res_smdi.c:876:19: warning: address of array 'search_msg->mesg_desk_num' will always evaluate to 'true' [-Wpointer-bool-conversion]
                if (search_msg->mesg_desk_num) {
                ~~  ~~~~~~~~~~~~^~~~~~~~~~~~~
res_smdi.c:879:19: warning: address of array 'search_msg->mesg_desk_term' will always evaluate to 'true' [-Wpointer-bool-conversion]
                if (search_msg->mesg_desk_term) {
                ~~  ~~~~~~~~~~~~^~~~~~~~~~~~~~

Changed: removed the superfluous checks

 
Review request changed
Updated (April 8, 2015, 7:28 a.m.)
  • changed from pending to submitted
Committed in revision 434313

https://reviewboard.asterisk.org/ runs on a server provided by Digium, Inc. and uses bandwidth donated to the open source Asterisk community by API Digital Communications in Huntsville, AL USA.
Please report problems with this site to asteriskteam@digium.com.