[Scummvm-git-logs] scummvm master -> a46253647a8a171e3f5fd1c3c4785dcb21525e61
dwatteau
noreply at scummvm.org
Wed Jun 21 10:57:01 UTC 2023
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
a46253647a COMMON: BUILD: Try detecting UBSan when not using configure
Commit: a46253647a8a171e3f5fd1c3c4785dcb21525e61
https://github.com/scummvm/scummvm/commit/a46253647a8a171e3f5fd1c3c4785dcb21525e61
Author: Donovan Watteau (contrib at dwatteau.fr)
Date: 2023-06-21T12:56:58+02:00
Commit Message:
COMMON: BUILD: Try detecting UBSan when not using configure
Newer versions of Clang can tell us when UBSan has been enabled, which
is useful to define SCUMM_NEED_ALIGNMENT when -fsanitize=alignment is
in use (https://reviews.llvm.org/D52386).
Can be useful to avoid some false positives about alignment when doing
a build with UBSan but without using the "configure" script which
already tries to detect this setting.
See earlier commit 8a73f5d496437f8211c67c1da4c6cc4b200c4970.
Changed paths:
common/scummsys.h
diff --git a/common/scummsys.h b/common/scummsys.h
index 8fbe5eee816..cab204ba105 100644
--- a/common/scummsys.h
+++ b/common/scummsys.h
@@ -267,6 +267,14 @@
//
#if !defined(HAVE_CONFIG_H)
+ // If -fsanitize=undefined or -fsanitize=alignment is in use, and the
+ // compiler happens to report it, make sure SCUMM_NEED_ALIGNMENT is
+ // defined, in order to avoid false positives when not using the
+ // "configure" script to enable UBSan.
+ #if __has_feature(undefined_behavior_sanitizer)
+ #define SCUMM_NEED_ALIGNMENT
+ #endif
+
#if defined(__DC__) || \
defined(__DS__) || \
defined(__3DS__) || \
More information about the Scummvm-git-logs
mailing list