SDL_GetAssertionReport(3)

πŸŽ€ NAME πŸŽ€

SDL_GetAssertionReport β€” it gets you a list of all assertion failures πŸ’– (and yes, this one lives in the SDL3 FUNCTIONS section of the manual, bestie, so you know it's the real deal).


✨ SYNOPSIS ✨

#include <SDL3/SDL_assert.h>

const SDL_AssertData * SDL_GetAssertionReport(void);

🌸 DESCRIPTION 🌸

okay so this function grabs every single assertion that's been triggered since the last time somebody called SDL_ResetAssertionReport(), or since the program started β€” whichever came most recently. like, the full receipts. πŸ’…

and the proper way to actually look at this data? it's giving very much this vibe:

const SDL_AssertData *item = SDL_GetAssertionReport();
while (item) {
   printf("'%s', %s (%s:%d), triggered %u times, always ignore: %s.\\n",
          item->condition, item->function, item->filename,
          item->linenum, item->trigger_count,
          item->always_ignore ? "yes" : "no");
   item = item->next;
}

walk the linked list, print the tea, move to item->next. iconic. πŸ¦‹


πŸ’– RETURN VALUE πŸ’–

  • *) it returns a list of all failed assertions, or NULL if the list is empty (crying, nothing to see, everything's fine πŸ₯²).
⚠️ bestie listen: this memory should not be modified or freed by your application. not yours. hands off. πŸ™ˆ
πŸ’€ and that pointer stays valid only until the next call to SDL_Quit() or SDL_ResetAssertionReport(). after that? poof. gone. don't be caught holding it. ✨

🧚 THREAD SAFETY 🧚

ngl, this function is not thread safe. 😭 if other threads are calling SDL_ResetAssertionReport() at the same time as you, they may render the pointer you got back invalid. it's giving chaos, it's giving undefined-vibes-adjacent energy, so like β€” don't. 🫢


🌈 AVAILABILITY 🌈

this one's been serving since SDL 3.2.0. old enough to be trusted, young enough to still be fresh. πŸ‘‘


πŸ‘‘ SEE ALSO πŸ‘‘


k bye, this was Simple Directmedia Layer's manpage for SDL 3.4.18, SDL_GetAssertionReport(3) β€” stay slay, go clear your assertion report, mwah πŸ’œπŸ’…βœ¨

πŸ“¦ where this page comes from