SDL_GetAssertionReport - Man Page

Get a list of all assertion failures.

Header File

Defined in SDL3/SDL_assert.h

Synopsis

#include "SDL3/SDL.h"

const SDL_AssertData * SDL_GetAssertionReport(void);

Description

This function gets all assertions triggered since the last call to

SDL_ResetAssertionReport (), or the start of the program.

The proper way to examine this data looks something like this:

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;
}

Return Value

(const SDL_AssertData
*) Returns a list of all failed assertions or NULL if the list is empty. This memory should not be modified or freed by the application. This pointer remains valid until the next call to SDL_Quit () or

SDL_ResetAssertionReport ().

Thread Safety

This function is not thread safe. Other threads calling

SDL_ResetAssertionReport () simultaneously, may render the returned pointer invalid.

Availability

This function is available since SDL 3.2.0.

See Also

·(3), SDL_ResetAssertionReport(3)

Referenced By

SDL_ResetAssertionReport(3).

SDL 3.2.2 Simple Directmedia Layer SDL3 FUNCTIONS