summaryrefslogtreecommitdiff
path: root/src/sp_pcre_compat.h
diff options
context:
space:
mode:
authorChristian Göttsche2024-05-27 21:32:37 +0200
committerjvoisin2024-06-06 16:27:13 +0200
commit97836fae360422baf9c62dd0eb0de6e7b2cfab09 (patch)
tree99227ae43068915635b045ce2de8c26e1da2ac5f /src/sp_pcre_compat.h
parentf8824a79ff69a2246a61e6381f0bc1e377e16a90 (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_pcre_compat.h')
-rw-r--r--src/sp_pcre_compat.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/sp_pcre_compat.h b/src/sp_pcre_compat.h
index 6e9d91a..5770df0 100644
--- a/src/sp_pcre_compat.h
+++ b/src/sp_pcre_compat.h
@@ -35,7 +35,7 @@ typedef struct {
35static inline sp_regexp* sp_regexp_compile(zend_string *zstr) { 35static inline sp_regexp* sp_regexp_compile(zend_string *zstr) {
36 sp_pcre *re = sp_pcre_compile(ZSTR_VAL(zstr)); 36 sp_pcre *re = sp_pcre_compile(ZSTR_VAL(zstr));
37 if (!re) { return NULL; } 37 if (!re) { return NULL; }
38 sp_regexp *ret = pecalloc(sizeof(sp_regexp), 1, 1); 38 sp_regexp *ret = pecalloc(1, sizeof(sp_regexp), 1);
39 ret->re = re; 39 ret->re = re;
40 ret->pattern = zstr; 40 ret->pattern = zstr;
41 return ret; 41 return ret;