Re: [asterisk-dev] [Code Review] 4541: clang compiler warning: -Wpointer-bool-conversion
--- This is an automatically generated e-mail. To reply, visit: https://reviewboard.asterisk.org/r/4541/ --- (Updated April 8, 2015, 6:42 a.m.) Status -- This change has been marked as submitted. Review request for Asterisk Developers. Changes --- Committed in revision 434285 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 -- _ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- asterisk-dev mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-dev
Re: [asterisk-dev] [Code Review] 4541: clang compiler warning: -Wpointer-bool-conversion
On April 7, 2015, 1:05 a.m., rmudgett wrote: /branches/13/apps/app_minivm.c, line 1842 https://reviewboard.asterisk.org/r/4541/diff/3/?file=73407#file73407line1842 Missing the ! if (!ast_strlen_zero()) Diederik de Groot wrote: Thanks again for checking my stuff, and sorry for the mistakes. Sorry for telling you wrong to begin with. - Mark --- This is an automatically generated e-mail. To reply, visit: https://reviewboard.asterisk.org/r/4541/#review15081 --- On April 7, 2015, 2:23 a.m., Diederik de Groot wrote: --- This is an automatically generated e-mail. To reply, visit: https://reviewboard.asterisk.org/r/4541/ --- (Updated April 7, 2015, 2:23 a.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 -- _ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- asterisk-dev mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-dev
Re: [asterisk-dev] [Code Review] 4541: clang compiler warning: -Wpointer-bool-conversion
On April 7, 2015, 3:05 a.m., rmudgett wrote: /branches/13/apps/app_minivm.c, line 1842 https://reviewboard.asterisk.org/r/4541/diff/3/?file=73407#file73407line1842 Missing the ! if (!ast_strlen_zero()) Diederik de Groot wrote: Thanks again for checking my stuff, and sorry for the mistakes. Mark Michelson wrote: Sorry for telling you wrong to begin with. That's what you get when copying from other people without discriminating the input... Should have learned that in school at some point :-) - Diederik --- This is an automatically generated e-mail. To reply, visit: https://reviewboard.asterisk.org/r/4541/#review15081 --- On April 7, 2015, 4:23 a.m., Diederik de Groot wrote: --- This is an automatically generated e-mail. To reply, visit: https://reviewboard.asterisk.org/r/4541/ --- (Updated April 7, 2015, 4:23 a.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 -- _ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- asterisk-dev mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-dev
Re: [asterisk-dev] [Code Review] 4541: clang compiler warning: -Wpointer-bool-conversion
--- This is an automatically generated e-mail. To reply, visit: https://reviewboard.asterisk.org/r/4541/#review15106 --- Ship it! Minor nit and then it's good to go. /branches/13/apps/app_minivm.c https://reviewboard.asterisk.org/r/4541/#comment25782 Might as well fix the comment typo while changing the line anyway. Rest - Reset - rmudgett On April 6, 2015, 9:23 p.m., Diederik de Groot wrote: --- This is an automatically generated e-mail. To reply, visit: https://reviewboard.asterisk.org/r/4541/ --- (Updated April 6, 2015, 9:23 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 -- _ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- asterisk-dev mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-dev
Re: [asterisk-dev] [Code Review] 4541: clang compiler warning: -Wpointer-bool-conversion
On April 7, 2015, 9:32 p.m., rmudgett wrote: /branches/13/apps/app_minivm.c, line 1872 https://reviewboard.asterisk.org/r/4541/diff/4/?file=73676#file73676line1872 Might as well fix the comment typo while changing the line anyway. Rest - Reset Another One Done.. Just a few left. - Diederik --- This is an automatically generated e-mail. To reply, visit: https://reviewboard.asterisk.org/r/4541/#review15106 --- On April 8, 2015, 1:18 a.m., Diederik de Groot wrote: --- This is an automatically generated e-mail. To reply, visit: https://reviewboard.asterisk.org/r/4541/ --- (Updated April 8, 2015, 1:18 a.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 -- _ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- asterisk-dev mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-dev
Re: [asterisk-dev] [Code Review] 4541: clang compiler warning: -Wpointer-bool-conversion
--- This is an automatically generated e-mail. To reply, visit: https://reviewboard.asterisk.org/r/4541/ --- (Updated April 8, 2015, 1:18 a.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 (updated) - /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 -- _ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- asterisk-dev mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-dev
Re: [asterisk-dev] [Code Review] 4541: clang compiler warning: -Wpointer-bool-conversion
--- 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 -- _ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- asterisk-dev mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-dev
Re: [asterisk-dev] [Code Review] 4541: clang compiler warning: -Wpointer-bool-conversion
On April 7, 2015, 3:05 a.m., rmudgett wrote: /branches/13/apps/app_minivm.c, line 1842 https://reviewboard.asterisk.org/r/4541/diff/3/?file=73407#file73407line1842 Missing the ! if (!ast_strlen_zero()) Thanks again for checking my stuff, and sorry for the mistakes. - Diederik --- This is an automatically generated e-mail. To reply, visit: https://reviewboard.asterisk.org/r/4541/#review15081 --- On April 7, 2015, 4:23 a.m., Diederik de Groot wrote: --- This is an automatically generated e-mail. To reply, visit: https://reviewboard.asterisk.org/r/4541/ --- (Updated April 7, 2015, 4:23 a.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 -- _ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- asterisk-dev mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-dev
Re: [asterisk-dev] [Code Review] 4541: clang compiler warning: -Wpointer-bool-conversion
On March 31, 2015, 5:50 p.m., Mark Michelson wrote: /branches/13/apps/app_queue.c, lines 9089-9093 https://reviewboard.asterisk.org/r/4541/diff/1/?file=73002#file73002line9089 This change is not correct. While the mem-state_interface will always be non-NULL (thanks, clang!), it may not have been configured and will therefore be zero-length. The correct fix here is to switch the previous if (mem-state_interface) to be if (ast_strlen_zero(mem-state_interface)) Thanks for pointing that one out. Fixed using if (!ast_strlen_zero(mem-state_interface)) instead :-) On March 31, 2015, 5:50 p.m., Mark Michelson wrote: /branches/13/res/res_smdi.c, lines 876-881 https://reviewboard.asterisk.org/r/4541/diff/1/?file=73004#file73004line876 This change is incorrect. The if checks should be changed to if (ast_strlen_zero(search_msg-mesg_dsk_num)) and if (ast_strlen_zero(search_msg-mesg_desk_term)) Fixed using if (!ast_strlen_zero(...)) instead. Thanks Mark ! - Diederik --- This is an automatically generated e-mail. To reply, visit: https://reviewboard.asterisk.org/r/4541/#review14978 --- On March 31, 2015, 6:05 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, 6:05 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 -- _ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- asterisk-dev mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-dev
Re: [asterisk-dev] [Code Review] 4541: clang compiler warning: -Wpointer-bool-conversion
--- This is an automatically generated e-mail. To reply, visit: https://reviewboard.asterisk.org/r/4541/ --- (Updated March 31, 2015, 6:05 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 (updated) - /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 -- _ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- asterisk-dev mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-dev
Re: [asterisk-dev] [Code Review] 4541: clang compiler warning: -Wpointer-bool-conversion
--- This is an automatically generated e-mail. To reply, visit: https://reviewboard.asterisk.org/r/4541/#review14985 --- Ship it! There's only one finding left and it's just to swap two lines of code, so I'm giving a ship it! /branches/13/apps/app_minivm.c https://reviewboard.asterisk.org/r/4541/#comment25609 The if check here should be before the ast_copy_string() operation. Basically, setting oldlocale to something in the case that etemplate-locale is zero-length is a wasted operation since we will not end up doing anything with oldlocale in that case. - Mark Michelson On March 31, 2015, 4:05 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, 4:05 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 -- _ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- asterisk-dev mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-dev
Re: [asterisk-dev] [Code Review] 4541: clang compiler warning: -Wpointer-bool-conversion
--- This is an automatically generated e-mail. To reply, visit: https://reviewboard.asterisk.org/r/4541/#review14978 --- /branches/13/apps/app_minivm.c https://reviewboard.asterisk.org/r/4541/#comment25600 This should be if (ast_strlen_zero(etemplate-locale)) /branches/13/apps/app_minivm.c https://reviewboard.asterisk.org/r/4541/#comment25601 This should be if (ast_strlen_zero(etemplate-locale)) /branches/13/apps/app_queue.c https://reviewboard.asterisk.org/r/4541/#comment25597 This change is not correct. While the mem-state_interface will always be non-NULL (thanks, clang!), it may not have been configured and will therefore be zero-length. The correct fix here is to switch the previous if (mem-state_interface) to be if (ast_strlen_zero(mem-state_interface)) /branches/13/res/res_smdi.c https://reviewboard.asterisk.org/r/4541/#comment25599 This change is incorrect. The if checks should be changed to if (ast_strlen_zero(search_msg-mesg_dsk_num)) and if (ast_strlen_zero(search_msg-mesg_desk_term)) - Mark Michelson On March 27, 2015, 12:13 p.m., Diederik de Groot wrote: --- This is an automatically generated e-mail. To reply, visit: https://reviewboard.asterisk.org/r/4541/ --- (Updated March 27, 2015, 12:13 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 -- _ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- asterisk-dev mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-dev
Re: [asterisk-dev] [Code Review] 4541: clang compiler warning: -Wpointer-bool-conversion
--- This is an automatically generated e-mail. To reply, visit: https://reviewboard.asterisk.org/r/4541/ --- (Updated March 31, 2015, 7: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 (updated) - /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 -- _ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- asterisk-dev mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-dev
Re: [asterisk-dev] [Code Review] 4541: clang compiler warning: -Wpointer-bool-conversion
--- This is an automatically generated e-mail. To reply, visit: https://reviewboard.asterisk.org/r/4541/ --- (Updated March 27, 2015, 1:13 p.m.) Review request for Asterisk Developers. Bugs: ASTERISK-24917 https://issues.asterisk.org/jira/browse/ASTERISK-24917 Repository: Asterisk Description (updated) --- 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 -- _ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- asterisk-dev mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-dev