diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bd83c3f64..e6a45c941 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -30,6 +30,8 @@ jobs: matrix: include: - SWIGLANG: "" + env: + CPPFLAGS: -DDOH_POISON - SWIGLANG: "" GCC: 7 - SWIGLANG: "" diff --git a/Source/DOH/doh.h b/Source/DOH/doh.h index 7b74eac7b..af6b99664 100644 --- a/Source/DOH/doh.h +++ b/Source/DOH/doh.h @@ -488,7 +488,7 @@ extern void DohMemoryDebug(void); #define doh_internal_malloc malloc #define doh_internal_realloc realloc -#ifdef __GNUC__ +#if defined __GNUC__ && defined DOH_POISON /* Use Malloc(), Realloc(), Calloc(), and Free() instead (which will exit with * an error rather than return NULL). */ @@ -496,15 +496,11 @@ extern void DohMemoryDebug(void); /* This works around bison's template checking if malloc and free are defined, * which triggers GCC's poison checks. */ -/* # pragma GCC poison malloc free -# pragma GCC poison realloc calloc -*/ # endif +# pragma GCC poison realloc calloc /* Use Exit() instead (which will remove output files on error). */ -/* # pragma GCC poison abort exit -*/ #endif #endif /* DOH_H */