<p>Patch set 3:<span style="border-radius: 3px; display: inline-block; margin: 0 2px; padding: 4px;background-color: #ffd4d4;">Code-Review -1</span></p><p><a href="https://gerrit.asterisk.org/10149">View Change</a></p><p>2 comments:</p><ul style="list-style: none; padding: 0;"><li style="margin: 0; padding: 0;"><p><a href="https://gerrit.asterisk.org/#/c/10149/3/include/asterisk/json.h">File include/asterisk/json.h:</a></p><ul style="list-style: none; padding: 0;"><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/#/c/10149/3/include/asterisk/json.h@116">Patch Set #3, Line 116:</a> <code style="font-family:monospace,monospace">#if (HAVE_LLONG_MAX == 1 && HAVE_STRTOLL == 1)</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">Richard's comment about this on the master review is correct, we need to check if these are defined. This would cause a compile error if 'long long' is not supported.</p><p style="white-space: pre-wrap; word-wrap: break-word;">To see this for yourself you can try compiling the following:<br>#if (HAVE_THIS_DOES_NOT_EXIST == 1)<br>#endif</p></li></ul></li><li style="margin: 0; padding: 0;"><p><a href="https://gerrit.asterisk.org/#/c/10149/3/main/json.c">File main/json.c:</a></p><ul style="list-style: none; padding: 0;"><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/#/c/10149/3/main/json.c@59">Patch Set #3, Line 59:</a> <code style="font-family:monospace,monospace"> int json_int_check[1 / (sizeof(ast_json_int_t) == sizeof(json_int_t))];</code></p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;">This needs serious explanation.</blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">If the sizes do not equal then for example (8 == 4) evaluates to 0, this would cause a divide by zero error (I think).</p><p style="white-space: pre-wrap; word-wrap: break-word;">I think the following would be better:<br>#if (JSON_INTEGER_IS_LONG_LONG && !(defined(HAVE_LLONG_MAX) && defined(HAVE_STRTOLL)) || (!JSON_INTEGER_IS_LONG_LONG && (defined(HAVE_LLONG_MAX) && defined(HAVE_STRTOLL))<br>#error "Mismatched long long usage between jansson and Asterisk."<br>#endif</p><p style="white-space: pre-wrap; word-wrap: break-word;"><br>Honestly I'm not sure we need to bother with this check. The chances of jansson changing the way it detects support for 'long long' is nearly non-existent. That's the only way this would ever throw an error is if jansson added a new requirement which is unavailable on the system.</p><p style="white-space: pre-wrap; word-wrap: break-word;">In theory configure.ac should detect JSON_INTEGER_IS_LONG_LONG but that would require some tweaking of the way bundled jansson is built.</p></li></ul></li></ul><p>To view, visit <a href="https://gerrit.asterisk.org/10149">change 10149</a>. To unsubscribe, or for help writing mail filters, 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/10149"/><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: I2af275286ee5e795b79f0c3d450d9e4b28e958b0 </div>
<div style="display:none"> Gerrit-Change-Number: 10149 </div>
<div style="display:none"> Gerrit-PatchSet: 3 </div>
<div style="display:none"> Gerrit-Owner: Kevin Harwell <kharwell@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Corey Farrell <git@cfware.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: Thu, 20 Sep 2018 17:33:11 +0000 </div>
<div style="display:none"> Gerrit-HasComments: Yes </div>
<div style="display:none"> Gerrit-HasLabels: Yes </div>