mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02:00
Avoid MSVC unused variable warning in FastZPP
MSVC doesn't support __attribute__((unused)), so this can cause a lot of warnings for extensions. Use the (void) trick instead. However, this requires us to initialize the variable as well, to ensure that ubsan does not read a trap representation.
This commit is contained in:
parent
1671996ed7
commit
3ee6a4b35f
1 changed files with 2 additions and 1 deletions
|
@ -1282,7 +1282,7 @@ ZEND_API ZEND_COLD void zend_argument_value_error(uint32_t arg_num, const char *
|
|||
zval *_real_arg, *_arg = NULL; \
|
||||
zend_expected_type _expected_type = Z_EXPECTED_LONG; \
|
||||
char *_error = NULL; \
|
||||
ZEND_ATTRIBUTE_UNUSED zend_bool _dummy; \
|
||||
zend_bool _dummy = 0; \
|
||||
zend_bool _optional = 0; \
|
||||
int _error_code = ZPP_ERROR_OK; \
|
||||
((void)_i); \
|
||||
|
@ -1291,6 +1291,7 @@ ZEND_API ZEND_COLD void zend_argument_value_error(uint32_t arg_num, const char *
|
|||
((void)_expected_type); \
|
||||
((void)_error); \
|
||||
((void)_optional); \
|
||||
((void)_dummy); \
|
||||
\
|
||||
do { \
|
||||
if (UNEXPECTED(_num_args < _min_num_args) || \
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue