---
name: "SDL_assert_release"
section: "3"
platform: "linux"
package: "libsdl3-doc"
version: "3.2.10+ds-1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/SDL_assert_release"
---

# SDL\_assert\_release(3)

An assertion test that is performed even in release builds.

## NAME

SDL\_assert\_release - An assertion test that is performed even in release builds.

## HEADER FILE

Defined in SDL3/SDL\_assert.h

## SYNOPSIS

```
#include "SDL3/SDL.h"
```

**#define SDL\_assert\_release(condition) SDL\_disabled\_assert(condition)**

## DESCRIPTION

This macro is enabled when the  **SDL\_ASSERT\_LEVEL**\
  is \>= 1, otherwise it is disabled. This is meant to be for tests that are cheap to make and extremely unlikely to fail; generally it is frowned upon to have an assertion failure in a release build, so these assertions generally need to be of more than life-and-death importance if there's a chance they might trigger. You should almost always consider handling these cases more gracefully than an assert allows.

When assertions are disabled, this wraps **condition** in a **sizeof** operator, which means any function calls and side effects will not run, but the compiler will not complain about any otherwise-unused variables that are only referenced in the assertion.

One can set the environment variable " **SDL\_ASSERT** " to one of several strings ("abort", "break", "retry", "ignore", "always\_ignore") to force a default behavior, which may be desirable for automation purposes. If your platform requires GUI interfaces to happen on the main thread but you're debugging an assertion in a background thread, it might be desirable to set this to "break" so that your debugger takes control as soon as assert is triggered, instead of risking a bad UI interaction (deadlock, etc) in the application. \*

## THREAD SAFETY

It is safe to call this macro from any thread.

## AVAILABILITY

This macro is available since SDL 3.2.0.
