avr_assert(3)

πŸ“¦ version 2.2.1, in fedora 43, fedora 44, opensuse-leap 16.0

πŸ’– avr_assert πŸ’–

okay bestie, welcome to avr_assert(3) from the avr-libc girlies 🫢 this one's a whole mood and also genuinely useful, so let's get into it.


✨ NAME ✨

avr_assert β€” that's the whole name, that's the vibe, periodt πŸ’…


✨ SYNOPSIS ✨

Macros

#define assert(expression)

🌸 Detailed Description 🌸

#include <assert.h>

so this header file defines a debugging aid. that's it, that's the job πŸ’–

here's the tea though β€” there is no standard error output stream available for many applications using this library, which means the generation of a printable error message is not enabled by default. like, it's just not the default setting, no cap.

these messages will only be generated if your application defines the macro

__ASSERT_USE_STDERR

before including the <assert.h> header file. order matters bestie, don't come for me πŸ™ˆ

by default, only abort() will be called to halt the application. just abort(). that's the whole default behaviour, fr fr.


πŸŽ€ Macro Definition Documentation πŸŽ€

#define assert(expression)

Parameters:

  • expression β€” Expression to test for. (yes it's literally just the thing you're testing, iconic of it)

okay so the assert() macro tests the given expression, and if it is false, the calling process is terminated. like, gone. a diagnostic message is written to stderr and the function abort() is called, effectively terminating the program. it's giving dramatic exit πŸ’€

if expression is true, the assert() macro does nothing. silent. mysterious. main character energy ✨

not me telling you that the assert() macro may be removed at compile time by defining NDEBUG as a macro (e.g., by using the compiler option -DNDEBUG). so yeah, you can yeet all your asserts at build time if you want πŸ‘‘

πŸ‘‘ Author πŸ‘‘

Generated automatically by Doxygen for avr-libc from the source code. (not a human, just a lil robot doing its thing πŸ€–πŸ’œ)


that's the whole page bestie, you ate it up 🌈 this was Version 2.1.0, dated Sat Jan 29 2022, and yes the footer said avr_assert(3) again because it's consistent like that πŸ’… mwah, go write some asserts πŸ¦‹

πŸ“¦ where this page comes from