[php-src] PR #16511: Don't fiddle with NDEBUG in C code
| From: | cmb69 | Date: | Sat, 19 Oct 2024 14:55:12 +0000 |
| Subject: | [php-src] PR #16511: Don't fiddle with NDEBUG in C code | ||
| Groups: | php.git-pulls | ||
| Request: | Send a blank email to git-pulls+get-29315@lists.php.net to get a copy of this message | ||
Pull Request: https://github.com/php/php-src/pull/16511
Author: cmb69
It is way to late to do this in php.h, since assert.h has already been included. Even pushing that
down to zend_portability.h may not have the desired effect. Instead we define or undefine NDEBUG as
CFLAG, so that it works in all circumstances.
As a last resort we fail at build time, if
NDEBUG is defined when
ZEND_DEBUG is enabled.
We also remove the useless workaround in zend_test to include assert.h again, since that usually
won't have any effect anyway.
---
This is an alternative to #16366, which had been suggested by @arnaud-lb. I'm not quite sure
whether this works well for phpize builds.
Also note that Windows (un)defines the NDebug macro; I have no idea what that is about.