<p style="white-space: pre-wrap; word-wrap: break-word;">It kinda feels like you're "cheating" compiler in here to keep the 'const' in place. Sure, you can outsmart compiler but I don't think you should. The 'const' is just an indicator for you (and any other person reading the code) to make it easier to understand what the code touches. Compiler is trying its best to check this expectation at compile-time - this check isn't perfect and we shouldn't make it even harder.</p><p style="white-space: pre-wrap; word-wrap: break-word;">If you change some data - just drop the 'const' from corresponding pointer, even if compiler fails to warn you about it.</p><p style="white-space: pre-wrap; word-wrap: break-word;">Especially in this case where all the check_*() functions are called on buffer local to the mncc_data(), which isn't used after it's checked by single check_() function.</p><p>Patch set 6:<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.osmocom.org/12682">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.osmocom.org/#/c/12682/6/src/mncc.c">File src/mncc.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.osmocom.org/#/c/12682/6/src/mncc.c@418">Patch Set #6, Line 418:</a> <code style="font-family:monospace,monospace">     uint32_t fields;</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">Erm, why?</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.osmocom.org/#/c/12682/6/src/mncc.c@440">Patch Set #6, Line 440:</a> <code style="font-family:monospace,monospace">       if ((fields & MNCC_F_CALLING) == 0) {</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">I'd rather avoid changing this.</p></li></ul></li></ul><p>To view, visit <a href="https://gerrit.osmocom.org/12682">change 12682</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.osmocom.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.osmocom.org/12682"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: osmo-sip-connector </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-MessageType: comment </div>
<div style="display:none"> Gerrit-Change-Id: I5d0adb61dfa82e7ded5f41d9bc773d546112c9f1 </div>
<div style="display:none"> Gerrit-Change-Number: 12682 </div>
<div style="display:none"> Gerrit-PatchSet: 6 </div>
<div style="display:none"> Gerrit-Owner: Keith Whyte <keith@rhizomatica.org> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins Builder (1000002) </div>
<div style="display:none"> Gerrit-Reviewer: Keith Whyte <keith@rhizomatica.org> </div>
<div style="display:none"> Gerrit-Reviewer: Max <msuraev@sysmocom.de> </div>
<div style="display:none"> Gerrit-CC: Harald Welte <laforge@gnumonks.org> </div>
<div style="display:none"> Gerrit-Comment-Date: Mon, 28 Jan 2019 10:58:33 +0000 </div>
<div style="display:none"> Gerrit-HasComments: Yes </div>
<div style="display:none"> Gerrit-HasLabels: Yes </div>