mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-21 02:32:06 +00:00
Enable address sanitizer in develop builds (#834)
Co-authored-by: ISSOtm <eldredhabert0@gmail.com>
This commit is contained in:
@@ -36,6 +36,18 @@
|
||||
#include "helpers.h"
|
||||
#include "version.h"
|
||||
|
||||
#ifdef __clang__
|
||||
#if __has_feature(address_sanitizer) && !defined(__SANITIZE_ADDRESS__)
|
||||
#define __SANITIZE_ADDRESS__
|
||||
#endif /* __has_feature(address_sanitizer) && !defined(__SANITIZE_ADDRESS__) */
|
||||
#endif /* __clang__ */
|
||||
|
||||
#ifdef __SANITIZE_ADDRESS__
|
||||
// There are known, non-trivial to fix leaks. We would still like to have `make develop'
|
||||
// detect memory corruption, though.
|
||||
const char *__asan_default_options(void) { return "detect_leaks=0"; }
|
||||
#endif
|
||||
|
||||
// Old Bison versions (confirmed for 2.3) do not forward-declare `yyparse` in the generated header
|
||||
// Unfortunately, macOS still ships 2.3, which is from 2008...
|
||||
int yyparse(void);
|
||||
|
||||
Reference in New Issue
Block a user