[asterisk-dev] [Code Review] 4541: clang compiler warning: -Wpointer-bool-conversion

rmudgett reviewboard at asterisk.org
Mon Apr 6 20:05:22 CDT 2015


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviewboard.asterisk.org/r/4541/#review15081
-----------------------------------------------------------



/branches/13/apps/app_minivm.c
<https://reviewboard.asterisk.org/r/4541/#comment25760>

    Missing the !
    
    if (!ast_strlen_zero())



/branches/13/apps/app_minivm.c
<https://reviewboard.asterisk.org/r/4541/#comment25761>

    Same



/branches/13/apps/app_minivm.c
<https://reviewboard.asterisk.org/r/4541/#comment25762>

    red blob


- rmudgett


On March 31, 2015, 12:15 p.m., Diederik de Groot wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviewboard.asterisk.org/r/4541/
> -----------------------------------------------------------
> 
> (Updated March 31, 2015, 12:15 p.m.)
> 
> 
> Review request for Asterisk Developers.
> 
> 
> Bugs: ASTERISK-24917
>     https://issues.asterisk.org/jira/browse/ASTERISK-24917
> 
> 
> Repository: Asterisk
> 
> 
> Description
> -------
> 
> 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
> 
> 
> Diffs
> -----
> 
>   /branches/13/res/res_smdi.c 433444 
>   /branches/13/channels/chan_pjsip.c 433444 
>   /branches/13/apps/app_queue.c 433444 
>   /branches/13/apps/app_minivm.c 433444 
> 
> Diff: https://reviewboard.asterisk.org/r/4541/diff/
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> Diederik de Groot
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20150407/b826d749/attachment-0001.html>


More information about the asterisk-dev mailing list