<p style="white-space: pre-wrap; word-wrap: break-word;">I actually think this is bogus. We are not type-casting uint32_t values (or structs containing uint32_t) to random locations in memory.  Rather, we are puting a struct if uint32_t on the stack and then passing pointers to members of it.  I would have assumed that the compiler puts the structure on the stack in a way that the uint32_t are properly aligned.</p><p style="white-space: pre-wrap; word-wrap: break-word;">After all, if you had all those uint32_t individually on the stack, you would also expect they're all 32bit aligned and you could use them as uint32_t.</p><p style="white-space: pre-wrap; word-wrap: break-word;">Maybe it's the __attribute((packed)) which is putting clang off?  It's not really needed here, as all (I hope at least) architectures are putting two uint32_t next to each other in a struct, without any padding.  Maybe there were any early "true" 64bit architectures like ppc64 or itanium or sparc65 that would align them on 64bit boundaries, but I somehow doubt it.</p><p><a href="https://gerrit.osmocom.org/13768">View Change</a></p><ul style="list-style: none; padding: 0;"></ul><p>To view, visit <a href="https://gerrit.osmocom.org/13768">change 13768</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/13768"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: osmo-bts </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-MessageType: comment </div>
<div style="display:none"> Gerrit-Change-Id: Ifba33cfd8edeccc99a21c7d076db7119c29d4f40 </div>
<div style="display:none"> Gerrit-Change-Number: 13768 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Vadim Yanitskiy <axilirator@gmail.com> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins Builder (1000002) </div>
<div style="display:none"> Gerrit-CC: Harald Welte <laforge@gnumonks.org> </div>
<div style="display:none"> Gerrit-Comment-Date: Wed, 24 Apr 2019 07:47:17 +0000 </div>
<div style="display:none"> Gerrit-HasComments: No </div>
<div style="display:none"> Gerrit-HasLabels: No </div>