<p> Attention is currently required from: Joshua Colp. </p>
<p><a href="https://gerrit.asterisk.org/c/asterisk/+/16661">View Change</a></p><p>1 comment:</p><ul style="list-style: none; padding: 0;"><li style="margin: 0; padding: 0;"><p><a href="null">Patchset:</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/asterisk/+/16661?tab=comments">Patch Set #1:</a> </p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;">What's the long names that are being truncated? What does the difference look like for this?</blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">For C there is no difference as far as I can tell.</p><p style="white-space: pre-wrap; word-wrap: break-word;">Consider this example:</p><p style="white-space: pre-wrap; word-wrap: break-word;">#include <stdio.h></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">int function_name(int i1, int i2, int i3)<br>{<br> printf("__FUNCTION__ = %s\n", __FUNCTION__);<br> printf("__PRETTY_FUNCTION__ = %s\n", __PRETTY_FUNCTION__);<br> return i1+i2+i3;<br>}</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">int main()<br>{<br> return function_name(0, 1, -1);<br>}</pre><p style="white-space: pre-wrap; word-wrap: break-word;">When compiled as "C", this outputs:</p><p style="white-space: pre-wrap; word-wrap: break-word;">__FUNCTION__ = function_name<br>__PRETTY_FUNCTION__ = function_name</p><p style="white-space: pre-wrap; word-wrap: break-word;">When compiled as "C++", this outputs:</p><p style="white-space: pre-wrap; word-wrap: break-word;">__FUNCTION__ = function_name<br>__PRETTY_FUNCTION__ = int function_name(int, int, int)</p><p style="white-space: pre-wrap; word-wrap: break-word;">This gets even more interesting when using classes:</p><p style="white-space: pre-wrap; word-wrap: break-word;">#include <stdio.h></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">class Function {<br>public:<br> static int name(int i1, int i2, int i3)<br> {<br> printf("__FUNCTION__ = %s\n", __FUNCTION__);<br> printf("__PRETTY_FUNCTION__ = %s\n", __PRETTY_FUNCTION__);<br> return i1+i2+i3;<br> }<br>};</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">int main()<br>{<br> return Function::name(0, 1, -1);<br>}</pre><p style="white-space: pre-wrap; word-wrap: break-word;">__FUNCTION__ = name<br>__PRETTY_FUNCTION__ = static int Function::name(int, int, int)</p><p style="white-space: pre-wrap; word-wrap: break-word;">So for in-tree functions this will make very little (if any difference), however, for external modules it'll shorten the length of the names prefixed to log entries tremendously.</p></li></ul></li></ul><p>To view, visit <a href="https://gerrit.asterisk.org/c/asterisk/+/16661">change 16661</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/c/asterisk/+/16661"/><meta itemprop="name" content="View Change"/></div></div>
<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-Change-Id: I54101a0bb5f8cb9ef63ec12c5e0d4c8edafff9ed </div>
<div style="display:none"> Gerrit-Change-Number: 16661 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Jaco Kroon <jaco@uls.co.za> </div>
<div style="display:none"> Gerrit-Reviewer: Friendly Automation </div>
<div style="display:none"> Gerrit-CC: Joshua Colp <jcolp@sangoma.com> </div>
<div style="display:none"> Gerrit-Attention: Joshua Colp <jcolp@sangoma.com> </div>
<div style="display:none"> Gerrit-Comment-Date: Wed, 10 Nov 2021 13:40:12 +0000 </div>
<div style="display:none"> Gerrit-HasComments: Yes </div>
<div style="display:none"> Gerrit-Has-Labels: No </div>
<div style="display:none"> Comment-In-Reply-To: Joshua Colp <jcolp@sangoma.com> </div>
<div style="display:none"> Gerrit-MessageType: comment </div>