diff options
| author | Christian Göttsche | 2024-05-27 21:32:37 +0200 |
|---|---|---|
| committer | jvoisin | 2024-06-06 16:27:13 +0200 |
| commit | 97836fae360422baf9c62dd0eb0de6e7b2cfab09 (patch) | |
| tree | 99227ae43068915635b045ce2de8c26e1da2ac5f /src/sp_config_keywords.c | |
| parent | f8824a79ff69a2246a61e6381f0bc1e377e16a90 (diff) | |
Reorder calloc(3) arguments
Please GCC:
In file included from /usr/include/php/20220829/Zend/zend.h:30,
from /usr/include/php/20220829/main/php.h:31,
from /usr/include/php/20220829/main/SAPI.h:20,
from src/php_snuffleupagus.h:37,
from src/sp_ifilter.c:1:
src/sp_pcre_compat.h: In function 'sp_regexp_compile':
src/sp_pcre_compat.h:38:36: warning: '__zend_calloc' sizes specified with 'sizeof' in the earlier argument and not in the later argument [-Wcalloc-transposed-args]
38 | sp_regexp *ret = pecalloc(sizeof(sp_regexp), 1, 1);
| ^~~~~~~~~
/usr/include/php/20220829/Zend/zend_alloc.h:199:72: note: in definition of macro 'pecalloc'
199 | #define pecalloc(nmemb, size, persistent) ((persistent)?__zend_calloc((nmemb), (size)):ecalloc((nmemb), (size)))
| ^~~~~
src/sp_pcre_compat.h:38:36: note: earlier argument should specify number of elements, later size of each element
38 | sp_regexp *ret = pecalloc(sizeof(sp_regexp), 1, 1);
| ^~~~~~~~~
/usr/include/php/20220829/Zend/zend_alloc.h:199:72: note: in definition of macro 'pecalloc'
199 | #define pecalloc(nmemb, size, persistent) ((persistent)?__zend_calloc((nmemb), (size)):ecalloc((nmemb), (size)))
| ^~~~~
Diffstat (limited to 'src/sp_config_keywords.c')
| -rw-r--r-- | src/sp_config_keywords.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/sp_config_keywords.c b/src/sp_config_keywords.c index 6733503..bf54428 100644 --- a/src/sp_config_keywords.c +++ b/src/sp_config_keywords.c | |||
| @@ -201,7 +201,7 @@ SP_PARSE_FN(parse_wrapper_whitelist) { | |||
| 201 | 201 | ||
| 202 | SP_PARSE_FN(parse_cookie) { | 202 | SP_PARSE_FN(parse_cookie) { |
| 203 | zend_string *samesite = NULL; | 203 | zend_string *samesite = NULL; |
| 204 | sp_cookie *cookie = pecalloc(sizeof(sp_cookie), 1, 1); | 204 | sp_cookie *cookie = pecalloc(1, sizeof(sp_cookie), 1); |
| 205 | 205 | ||
| 206 | sp_config_keyword config_keywords[] = { | 206 | sp_config_keyword config_keywords[] = { |
| 207 | {parse_str, SP_TOKEN_NAME, &(cookie->name)}, | 207 | {parse_str, SP_TOKEN_NAME, &(cookie->name)}, |
| @@ -302,7 +302,7 @@ SP_PARSE_FN(parse_disabled_functions) { | |||
| 302 | int ret = SP_PARSER_ERROR; | 302 | int ret = SP_PARSER_ERROR; |
| 303 | bool enable = false, disable = false, allow = false, drop = false; | 303 | bool enable = false, disable = false, allow = false, drop = false; |
| 304 | zend_string *var = NULL, *param = NULL; | 304 | zend_string *var = NULL, *param = NULL; |
| 305 | sp_disabled_function *df = pecalloc(sizeof(*df), 1, 1); | 305 | sp_disabled_function *df = pecalloc(1, sizeof(*df), 1); |
| 306 | df->pos = -1; | 306 | df->pos = -1; |
| 307 | 307 | ||
| 308 | sp_config_keyword config_keywords[] = { | 308 | sp_config_keyword config_keywords[] = { |
| @@ -507,7 +507,7 @@ SP_PARSE_FN(parse_ini_protection) { | |||
| 507 | } | 507 | } |
| 508 | 508 | ||
| 509 | SP_PARSE_FN(parse_ini_entry) { | 509 | SP_PARSE_FN(parse_ini_entry) { |
| 510 | sp_ini_entry *entry = pecalloc(sizeof(sp_ini_entry), 1, 1); | 510 | sp_ini_entry *entry = pecalloc(1, sizeof(sp_ini_entry), 1); |
| 511 | bool rw = false, ro = false; | 511 | bool rw = false, ro = false; |
| 512 | 512 | ||
| 513 | sp_config_keyword config_keywords[] = { | 513 | sp_config_keyword config_keywords[] = { |
