summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibC/assert.h
AgeCommit message (Collapse)Author
2022-12-03Everywhere: Run clang-formatLinus Groh
2022-04-01Everywhere: Run clang-formatIdan Horowitz
2021-12-23LibC: Allow multiple includes of `<assert.h>`Michel Hermier
ISO C requires in section 7.2: The assert macro is redefined according to the current state of NDEBUG each time that <assert.h> is included. Also add tests for `assert` multiple inclusion accordingly.
2021-12-18LibC: Move `_abort` next to `abort`Michel Hermier
It should be now the only user of it, and it is more logical to have it in `stdlib.h` than in `assert.h`
2021-12-18LibC: Remove `VERIFY_NOT_REACHED()` from `assert.h`Michel Hermier
Both `AK/Assertions.h` and `assert.h` would define the macro if `NDEBUG` is set. Remove the definition from `assert.h` since it is not an ISO-C requirement.
2021-07-13LibC: Use C-style void cast in assert()Linus Groh
2021-07-12LibC: Replace use of do/while in assert() with the ternary operatorLinus Groh
It's a single expression, no do/while needed. This makes assert() work with the comma operator (assert(foo), assert(bar), assert(baz)). Found because exactly this is being used somewhere in the guts of LLVM.
2021-07-12LibC: Use correct macro to disable assert()Andrew Kaster
The C standard doesn't say anything about DEBUG, just NDEBUG :^)
2021-07-03LibC: Don't use C++ attribute syntax in C-visible headersDaniel Bertalan
Fixes errors when building Clang's compiler-rt, which compiles in C11 more.
2021-06-08LibC+AK: Remove our custom macros from <assert.h>Gunnar Beutner
Other software might not expect these to be defined and behave differently if they _are_ defined, e.g. scummvm which checks if the TODO macro is defined and fails to build if it is.
2021-04-22Everything: Move to SPDX license identifiers in all files.Brian Gianforcaro
SPDX License Identifiers are a more compact / standardized way of representing file license information. See: https://spdx.dev/resources/use/#identifiers This was done with the `ambr` search and replace tool. ambr --no-parent-ignore --key-from-file --rep-from-file key.txt rep.txt *
2021-04-18Kernel+LibC: Clean up how assertions work in the kernel and LibCGunnar Beutner
This also brings LibC's abort() function closer to the spec.
2021-04-12LibC: Turn CRASH() into a function and add noreturn attributeGunnar Beutner
This way CRASH() can be used in functions that are themselves marked as noreturn.
2021-03-08LibC: Define static_assert in assert.h when it's being used in CMițca Dumitru
2021-02-23Everywhere: Remove unused RELEASE_ASSERT macroAndreas Kling
2021-02-23Everywhere: Rename ASSERT => VERIFYAndreas Kling
(...and ASSERT_NOT_REACHED => VERIFY_NOT_REACHED) Since all of these checks are done in release builds as well, let's rename them to VERIFY to prevent confusion, as everyone is used to assertions being compiled out in release. We can introduce a new ASSERT macro that is specifically for debug checks, but I'm doing this wholesale conversion first since we've accumulated thousands of these already, and it's not immediately obvious which ones are suitable for ASSERT.
2021-01-12Libraries: Move to Userland/Libraries/Andreas Kling