mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-26 09:30:24 +00:00
Kernel: Add -Wnull-dereference
flag
`-Wnull-dereference` has found a lot of "possible null dereferences" in userland. However, in the kernel, no warnings occurred. To keep it that way, preemptivly add the flag here and remove it once it is enabled system wide. This flag makes the compiler check statically for a null deref. It does not take into account any human-imposed invariants and as such, may need a `VERIFY(ptr);`, `if(ptr)`, or `if(!ptr)` before using a pointer. However, as long as a pointer is not reassigned, the verify will be valid, meaning that adding `VERIFY` can be done sparingly.
This commit is contained in:
parent
586f10b6e1
commit
4454735bf8
Notes:
sideshowbarker
2024-07-18 20:09:21 +09:00
Author: https://github.com/Nicholas-Baron Commit: https://github.com/SerenityOS/serenity/commit/4454735bf8e Pull-request: https://github.com/SerenityOS/serenity/pull/6386
1 changed files with 1 additions and 1 deletions
|
@ -298,7 +298,7 @@ set(SOURCES
|
|||
${C_SOURCES}
|
||||
)
|
||||
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unknown-warning-option -Wvla")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unknown-warning-option -Wvla -Wnull-dereference")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pie -fPIE -fno-rtti -ffreestanding -fbuiltin")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mno-80387 -mno-mmx -mno-sse -mno-sse2")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-asynchronous-unwind-tables")
|
||||
|
|
Loading…
Reference in a new issue