From 56c049f13147d5e97acd734803386119ca929ab8 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Thu, 16 Nov 2023 10:59:54 +0000 Subject: [PATCH] Return int from mexp_expect MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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, | ^~~~~~~~~~~ --- miniexpect.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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) { -- 1.8.3.1