SDL_NORETURN(3)
π SDL_NORETURN π
okay bestie, welcome to SDL_NORETURN β a macro that tags a function as never-returning. yes it's a whole vibe. this is the SDL3 FUNCTIONS page, and no, it's not as scary as it sounds π«Ά
β¨ NAME β¨
SDL_NORETURN β A macro to tag a function as never-returning. periodt. π
πΈ SYNOPSIS πΈ
#include <SDL3/SDL_begin_code.h>
#define SDL_NORETURN __attribute__((noreturn))
like, that's the whole thing. short and iconic. π
π¦ DESCRIPTION π¦
so here's the tea, bestie: this is a hint to the compiler that a function does not return. like, ever. it goes in, it does its thing, and it never comes back. the classic example? the C runtime's exit() function. π
this hint can lead to code optimizations, and it helps analyzers understand code flow better. basically it tells everyone "yeah, nothing after this call happens, don't worry about it."
and on compilers that don't have noreturn support? this is defined to nothing. no cap, it just poofs into the void. π«₯
this symbol is used in SDL's headers, but apps and other libraries are welcome to use it for their own interfaces as well. it's not gatekept, it's for everyone. π«Ά
β AVAILABILITY β
this macro is available since SDL 3.2.0. so if you're on anything older, sorry babe, no noreturn for you π
lowkey a tiny macro but highkey it's carrying the whole optimizer's understanding of your control flow. respect it. π§
and that's a wrap, bestie π this was the SDL_NORETURN(3) page from Simple Directmedia Layer, SDL 3.4.18 edition. go forth and never return β¨πΈπ
π¦ where this page comes from
- fedora 43: SDL3-devel 3.4.18-1.fc43 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- fedora 43: SDL3-devel 3.4.18-1.fc43 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- fedora 44: SDL3-devel 3.4.18-1.fc44 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- fedora 44: SDL3-devel 3.4.18-1.fc44 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms