<h3>Contribution description</h3>
<p>Bot gcc and clang allow generation of code to check for undefined behaviour at runtime, called the "undefined behaviour sanitizer" (ubsan).<br>
This PR adds some Makefile logic to enable it.</p>
<p>It also includes a commit that enables ubsan for the unittests.</p>
<p>Marked WIP as there are currently quite some hits for the unittests.</p>
<h3>Testing procedure</h3>
<p>Run unittests on native and hardware.</p>
<h3>Issues/PRs references</h3>
<ul>
<li></li>
</ul>

<hr>

<h4>You can view, comment on, or merge this pull request online at:</h4>
<p>  <a href='https://github.com/RIOT-OS/RIOT/pull/10782'>https://github.com/RIOT-OS/RIOT/pull/10782</a></p>

<h4>Commit Summary</h4>
<ul>
  <li>make: add initial ubsan support</li>
  <li>tests/unittest: enable trap on undefined behaviour</li>
</ul>

<h4>File Changes</h4>
<ul>
  <li>
    <strong>A</strong>
    <a href="https://github.com/RIOT-OS/RIOT/pull/10782/files#diff-0">makefiles/ubsan.inc.mk</a>
    (62)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/RIOT-OS/RIOT/pull/10782/files#diff-1">tests/unittests/Makefile</a>
    (3)
  </li>
</ul>

<h4>Patch Links:</h4>
<ul>
  <li><a href='https://github.com/RIOT-OS/RIOT/pull/10782.patch'>https://github.com/RIOT-OS/RIOT/pull/10782.patch</a></li>
  <li><a href='https://github.com/RIOT-OS/RIOT/pull/10782.diff'>https://github.com/RIOT-OS/RIOT/pull/10782.diff</a></li>
</ul>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/RIOT-OS/RIOT/pull/10782">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AEn7YKvEDC3S9wU9kJ_rf9RO7kTLAfXvks5vDzQegaJpZM4aDKNE">mute the thread</a>.<img src="https://github.com/notifications/beacon/AEn7YOzmFmZk08-cRBlcBOw0ry8qeyQXks5vDzQegaJpZM4aDKNE.gif" height="1" width="1" alt="" /></p>
<script type="application/json" data-scope="inboxmarkup">{"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/RIOT-OS/RIOT","title":"RIOT-OS/RIOT","subtitle":"GitHub repository","main_image_url":"https://github.githubassets.com/images/email/message_cards/header.png","avatar_image_url":"https://github.githubassets.com/images/email/message_cards/avatar.png","action":{"name":"Open in GitHub","url":"https://github.com/RIOT-OS/RIOT"}},"updates":{"snippets":[{"icon":"DESCRIPTION","message":"make: add ubsan support (#10782)"}],"action":{"name":"View Pull Request","url":"https://github.com/RIOT-OS/RIOT/pull/10782"}}}</script>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/RIOT-OS/RIOT/pull/10782",
"url": "https://github.com/RIOT-OS/RIOT/pull/10782",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>