From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 7896) id 995B93858D28; Sat, 29 Oct 2022 08:15:05 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 995B93858D28 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1667031321; bh=ha6bxstvqZC+ZgmFJN+ey6l+M8rhssFio0KvtyLXj4s=; h=From:To:Subject:Date:From; b=PNCcosZrHiETYszvyvTG3VXF8YyUZbRG1Zq3tgIacjwm6sKVveY8KlQPzxvW+pFu7 olrhR8fDwUh+Db8CD3nLWDQJSch2nNPXhrXJ1I0d1m+IMWXwdZXYK0tde6xBL5cGGW g9Ty/fYCLyZWgUcgcYflm+XhOmYuedhnerI8i4Tg= Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Tsukasa OI To: gdb-cvs@sourceware.org Subject: [binutils-gdb] sim/erc32: Use int32_t as IRQ callback argument X-Act-Checkin: binutils-gdb X-Git-Author: Tsukasa OI X-Git-Refname: refs/heads/master X-Git-Oldrev: e47530f72f587550b1ff2f2adcfa4f64ec702d82 X-Git-Newrev: 57e3eee069a54ca09d89055bf6eccff710f87ed8 Message-Id: <20221029081521.995B93858D28@sourceware.org> Date: Sat, 29 Oct 2022 08:15:05 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3D57e3eee069a5= 4ca09d89055bf6eccff710f87ed8 commit 57e3eee069a54ca09d89055bf6eccff710f87ed8 Author: Tsukasa OI Date: Sat Sep 24 09:54:32 2022 +0000 sim/erc32: Use int32_t as IRQ callback argument =20 Clang generates a warning if an argument is passed to a function without prototype (zero arguments, even without (void)). Such calls are deprec= ated forms of indefinite arguments passing ("-Wdeprecated-non-prototype"). On the default configuration, it (somehow) doesn't cause a build failur= e but a warning is generated. =20 But because the cause is the same as the issue the author fixed in "sim/erc32: Use int32_t as event callback argument", it would be better= to fix it now to prevent problems in the future. =20 To fix the issue, this commit makes struct irqcall to use int32_t as a callback (callback) argument of an IRQ. Diff: --- sim/erc32/README.sis | 6 +++--- sim/erc32/func.c | 2 +- sim/erc32/sis.h | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/sim/erc32/README.sis b/sim/erc32/README.sis index b85479ef039..f10fad91748 100644 --- a/sim/erc32/README.sis +++ b/sim/erc32/README.sis @@ -246,9 +246,9 @@ int32_t arg; unsigned int delta; =20 set_int(level,callback,arg) -int level; -void (*callback)(); -int arg; +int32_t level; +void (*callback)(int32_t); +int32_t arg; =20 clear_int(level) int level; diff --git a/sim/erc32/func.c b/sim/erc32/func.c index 85d3c0cb8ec..86a395fe560 100644 --- a/sim/erc32/func.c +++ b/sim/erc32/func.c @@ -874,7 +874,7 @@ init_event(void) } =20 void -set_int(int32_t level, void (*callback) (), int32_t arg) +set_int(int32_t level, void (*callback) (int32_t), int32_t arg) { irqarr[level & 0x0f].callback =3D callback; irqarr[level & 0x0f].arg =3D arg; diff --git a/sim/erc32/sis.h b/sim/erc32/sis.h index 36346cae641..df6b22c47b0 100644 --- a/sim/erc32/sis.h +++ b/sim/erc32/sis.h @@ -137,7 +137,7 @@ struct estate { }; =20 struct irqcell { - void (*callback) (); + void (*callback) (int32_t); int32_t arg; }; =20 @@ -184,7 +184,7 @@ struct disassemble_info; extern void dis_mem (uint32_t addr, uint32_t len, struct disassemble_info *info); extern void event (void (*cfunc) (int32_t), int32_t arg, uint64_t delta); -extern void set_int (int32_t level, void (*callback) (), int32_t arg); +extern void set_int (int32_t level, void (*callback) (int32_t), int32_t ar= g); extern void advance_time (struct pstate *sregs); extern uint32_t now (void); extern int wait_for_irq (void);