<p>Richard Mudgett <strong>posted comments</strong> on this change.</p><p><a href="https://gerrit.asterisk.org/8778">View Change</a></p><p>Patch set 2:<span style="border-radius: 3px; display: inline-block; margin: 0 2px; padding: 4px;background-color: #ffd4d4;">Code-Review -1</span></p><p>(1 comment)</p><ul style="list-style: none; padding-left: 20px;"><li><p><a href="https://gerrit.asterisk.org/#/c/8778/2/include/asterisk/utils.h">File include/asterisk/utils.h:</a></p><ul style="list-style: none; padding-left: 20px;"><li><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/#/c/8778/2/include/asterisk/utils.h@863">Patch Set #2, Line 863:</a> </p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;"><pre style="font-family: monospace,monospace; white-space: pre-wrap;">#define ast_assert_else(a, _else) if (__builtin_expect(!(a), 1)) { \<br> _ast_assert(0, # a, __FILE__, __LINE__, __PRETTY_FUNCTION__); \<br>       _else; \<br>}<br></pre></blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">You wanted examples.  Here are some horrid code examples pulled from asterisk code that currently do ast_assert(0) that you are inviting with this patch:</p><p style="white-space: pre-wrap; word-wrap: break-word;">ast_assert_else(conf, return -1);</p><p style="white-space: pre-wrap; word-wrap: break-word;">ast_assert_else(event, return);</p><p style="white-space: pre-wrap; word-wrap: break-word;">Yes the below will compile as ast_assert_else() is currently defined.  Note there is no semicolon on the end of the ast_assert_else() line.</p><p style="white-space: pre-wrap; word-wrap: break-word;">ast_assert_else(cdr, ({ ast_log(AST_LOG_WARNING, "No CDR for channel %s\n", caller ? caller->name : peer->name); return; }))<br>else if (new_snapshot) {<br>}</p><p style="white-space: pre-wrap; word-wrap: break-word;">ast_assert_else(!cdr_object_format_property(it_cdr, cdr_readonly_vars[i], workspace, sizeof(workspace)), continue);</p><p style="white-space: pre-wrap; word-wrap: break-word;">ast_assert_else(orig->v_table && orig->v_table->alloc_empty_clone_debug, return NULL);</p><p style="white-space: pre-wrap; word-wrap: break-word;">ast_assert_else(is_ao2_object(self) && self->v_table, ({prnt(where, "Invalid container\n"); return; }));</p></li></ul></li></ul><p>To view, visit <a href="https://gerrit.asterisk.org/8778">change 8778</a>. To unsubscribe, visit <a href="https://gerrit.asterisk.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.asterisk.org/8778"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: 13 </div>
<div style="display:none"> Gerrit-MessageType: comment </div>
<div style="display:none"> Gerrit-Change-Id: I0003844affeab550d5ff5bca7aa7cf8a559b873e </div>
<div style="display:none"> Gerrit-Change-Number: 8778 </div>
<div style="display:none"> Gerrit-PatchSet: 2 </div>
<div style="display:none"> Gerrit-Owner: George Joseph <gjoseph@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: George Joseph <gjoseph@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins2 </div>
<div style="display:none"> Gerrit-Reviewer: Richard Mudgett <rmudgett@digium.com> </div>
<div style="display:none"> Gerrit-Comment-Date: Fri, 13 Apr 2018 22:40:45 +0000 </div>
<div style="display:none"> Gerrit-HasComments: Yes </div>