Commit Graph

12 Commits

Author SHA1 Message Date
Linus Groh
552185066e LibC: Use C-style void cast in assert() 2021-07-13 19:02:20 +01:00
Linus Groh
15d5c62915 LibC: Replace use of do/while in assert() with the ternary operator
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-12 22:33:28 +01:00
Andrew Kaster
6ba87a6b5e LibC: Use correct macro to disable assert()
The C standard doesn't say anything about DEBUG, just NDEBUG :^)
2021-07-12 12:26:52 +02:00
Daniel Bertalan
842249aff5 LibC: Don't use C++ attribute syntax in C-visible headers
Fixes errors when building Clang's compiler-rt, which compiles in C11
more.
2021-07-03 01:56:31 +04:30
Gunnar Beutner
d2662df57c LibC+AK: Remove our custom macros from <assert.h>
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-06-08 17:29:57 +02:00
Brian Gianforcaro
1682f0b760 Everything: Move to SPDX license identifiers in all files.
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-22 11:22:27 +02:00
Gunnar Beutner
f033416893 Kernel+LibC: Clean up how assertions work in the kernel and LibC
This also brings LibC's abort() function closer to the spec.
2021-04-18 11:11:15 +02:00
Gunnar Beutner
44486e8818 LibC: Turn CRASH() into a function and add noreturn attribute
This way CRASH() can be used in functions that are themselves
marked as noreturn.
2021-04-12 22:30:06 +02:00
Mițca Dumitru
35829304d6 LibC: Define static_assert in assert.h when it's being used in C 2021-03-08 08:56:15 +01:00
Andreas Kling
679cc154e6 Everywhere: Remove unused RELEASE_ASSERT macro 2021-02-23 21:11:53 +01:00
Andreas Kling
5d180d1f99 Everywhere: Rename ASSERT => VERIFY
(...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-02-23 20:56:54 +01:00
Andreas Kling
13d7c09125 Libraries: Move to Userland/Libraries/ 2021-01-12 12:17:46 +01:00