From: Richard W.M. Jones Date: Thu, 16 Nov 2023 10:59:54 +0000 (+0000) Subject: Return int from mexp_expect X-Git-Url: http://git.annexia.org/?a=commitdiff_plain;ds=sidebyside;p=miniexpect.git Return int from mexp_expect GCC 13 highlights the mismatch between int and enum in the declared vs implemented return type. The return types are in this case compatible, but it's not generally safe to implicitly convert between int and enum. miniexpect.c:248:1: warning: conflicting types for ‘mexp_expect’ due to enum/integer mismatch; have ‘enum mexp_status(mexp_h *, const mexp_regexp *, pcre2_match_data_8 *)’ {aka ‘enum mexp_status(mexp_h *, const mexp_regexp *, struct pcre2_real_match_data_8 *)’} [-Wenum-int-mismatch] 248 | mexp_expect (mexp_h *h, const mexp_regexp *regexps, | ^~~~~~~~~~~ In file included from miniexpect.c:41: miniexpect.h:100:12: note: previous declaration of ‘mexp_expect’ with type ‘int(mexp_h *, const mexp_regexp *, pcre2_match_data_8 *)’ {aka ‘int(mexp_h *, const mexp_regexp *, struct pcre2_real_match_data_8 *)’} 100 | extern int mexp_expect (mexp_h *h, const mexp_regexp *regexps, | ^~~~~~~~~~~ --- diff --git a/miniexpect.c b/miniexpect.c index 8533514..9f3b7ba 100644 --- a/miniexpect.c +++ b/miniexpect.c @@ -244,7 +244,7 @@ mexp_spawnvf (unsigned flags, const char *file, char **argv) return NULL; } -enum mexp_status +int mexp_expect (mexp_h *h, const mexp_regexp *regexps, pcre2_match_data *match_data) {