Re-enable symbol poisoning in a CI job

It seems too brittle to enable by default as we'd have to avoid
including any system headers after doh.h, which is hard to enforce,
but just having it enabled for one CI job should avoid uses of the
poisoned symbols from being accidentally introduced.

See #2223
This commit is contained in:
Olly Betts 2022-03-15 11:11:26 +13:00
commit 9efcc785ae
2 changed files with 4 additions and 6 deletions

View file

@ -30,6 +30,8 @@ jobs:
matrix:
include:
- SWIGLANG: ""
env:
CPPFLAGS: -DDOH_POISON
- SWIGLANG: ""
GCC: 7
- SWIGLANG: ""

View file

@ -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 */