Skip to content

Commit

Permalink
refactor: improve readability of sanitizers
Browse files Browse the repository at this point in the history
Signed-off-by: msclock <[email protected]>
  • Loading branch information
msclock committed Mar 29, 2024
1 parent 1235e83 commit 8520ed3
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions cmake/test/Sanitizer.cmake
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#[[
Copyright (C) 2018-2022 by George Cave - [email protected]

Copyright (c) 2022, 2023 msclock - [email protected]
Copyright (c) 2022, 2024 msclock - [email protected]

Licensed under the Apache License, Version 2.0 (the "License"); you may not
use this file except in compliance with the License. You may obtain a copy of
Expand Down Expand Up @@ -51,10 +51,10 @@ ThreadSanitizer

ThreadSanitizer detects data races for multi-threaded code.

UndefinedBehaviourSanitizer
UndefinedSanitinzer
^^^^^^^^^^^^^^^^^^^^^^^^^^^

UndefinedBehaviourSanitizer detects the use of various features of C/C++ that
UndefinedSanitinzer detects the use of various features of C/C++ that
are explicitly listed as resulting in undefined behaviour. Most notably:
- Using misaligned or null pointer.
- Signed integer overflow
Expand Down Expand Up @@ -93,12 +93,12 @@ include(CheckCXXSourceCompiles)
include(${CMAKE_CURRENT_LIST_DIR}/../Common.cmake)

set(USE_SANITIZER
"Address"
"Address,Undefined"
CACHE STRING "Compile with sanitizer flags.")

message(
STATUS
"Activate sanitizer with USE_SANITIZER: ${USE_SANITIZER}
"Activate sanitizers with USE_SANITIZER: ${USE_SANITIZER}
Available Options:
USE_SANITIZER:
Address - detects most issues dealing with memory using -fsanitize=address(gcc/clang).
Expand All @@ -112,7 +112,8 @@ message(
USE_SANITIZER_EXTRA_FLAGS: Extra flags to pass to the sanitizer. Default to empty.
BLACKLIST_FILE: Path to a blacklist file for Undefined Behaviour sanitizer. Default to empty.
Note:
- Address,Memory can not used in combination")
- Thread can not work with Address and Leak sanitizers.
- Memory can not work with Address, Leak, and Thread sanitizers.")

string(TOLOWER "${USE_SANITIZER}" USE_SANITIZER)

Expand Down

0 comments on commit 8520ed3

Please sign in to comment.