<p>I'd say that (1) and (2) are internal APIs, so the can simply expect <code>len != 0</code>, as every caller of that API is "under our control" and can be checked and fixed by us. But I'd say (3) is a global API and should be prepared to be called with list elements that have <code>len == 0</code>. (Keeping in mind that this case is something that will only happen under rare circumstances, someone using that API will unlikely test for that. Treating <code>len == 0</code> gracefully there can potentially prevent a lot of pain and debugging when other code than GNRC uses the driver.)</p>

<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/issues/11163#issuecomment-472066830">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AEn7YDxbDuoIOGJB-A98UP-ZgWXlbfxHks5vV9J6gaJpZM4brCpu">mute the thread</a>.<img src="https://github.com/notifications/beacon/AEn7YGf10hIKUDvBmp-9fl1tuYUg-HExks5vV9J6gaJpZM4brCpu.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":"PERSON","message":"@maribu in #11163: I'd say that (1) and (2) are internal APIs, so the can simply expect `len != 0`, as every caller of that API is \"under our control\" and can be checked and fixed by us. But I'd say (3) is a global API and should be prepared to be called with list elements that have `len == 0`. (Keeping in mind that this case is something that will only happen under rare circumstances, someone using that API will unlikely test for that. Treating `len == 0` gracefully there can potentially prevent a lot of pain and debugging when other code than GNRC uses the driver.)"}],"action":{"name":"View Issue","url":"https://github.com/RIOT-OS/RIOT/issues/11163#issuecomment-472066830"}}}</script>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/RIOT-OS/RIOT/issues/11163#issuecomment-472066830",
"url": "https://github.com/RIOT-OS/RIOT/issues/11163#issuecomment-472066830",
"name": "View Issue"
},
"description": "View this Issue on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>