<p>Patch set 1:<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/c/libosmocore/+/16259">View Change</a></p><p>1 comment:</p><ul style="list-style: none; padding: 0;"><li style="margin: 0; padding: 0;"><p><a href="https://gerrit.osmocom.org/c/libosmocore/+/16259/1/include/osmocom/gsm/protocol/gsm_08_08.h">File include/osmocom/gsm/protocol/gsm_08_08.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.osmocom.org/c/libosmocore/+/16259/1/include/osmocom/gsm/protocol/gsm_08_08.h@46">Patch Set #1, Line 46:</a> <code style="font-family:monospace,monospace">union</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">Oh, be careful! Unions with bit-fields is a dangerous mix. I had a very bad experience with such constructions. At least on GCC it was not working as expected: all bit-fields actually share the same memory with the same offset (i.e. changing dlci_cc to 0x02 would also set both dlci_spare and dlci_sapi to 0x02). For more details, see (in Russian, but Google Translate can do the magic) https://www.stableit.ru/2016/02/union-bit-fields-c.html.</p><p style="white-space: pre-wrap; word-wrap: break-word;">Feel free to add a unit test setting different values to the bit-fields, and check their values.</p></li></ul></li></ul><p>To view, visit <a href="https://gerrit.osmocom.org/c/libosmocore/+/16259">change 16259</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/c/libosmocore/+/16259"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: libosmocore </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-Change-Id: Iec448af02d28e6c5c573e68a0b4a86067ec7e561 </div>
<div style="display:none"> Gerrit-Change-Number: 16259 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: pespin <pespin@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins Builder </div>
<div style="display:none"> Gerrit-Reviewer: fixeria <axilirator@gmail.com> </div>
<div style="display:none"> Gerrit-Comment-Date: Wed, 27 Nov 2019 12:39:21 +0000 </div>
<div style="display:none"> Gerrit-HasComments: Yes </div>
<div style="display:none"> Gerrit-Has-Labels: Yes </div>
<div style="display:none"> Gerrit-MessageType: comment </div>