public inbox for gdb-cvs@sourceware.org help / color / mirror / Atom feed
From: Tsukasa OI <a4lg@sourceware.org> To: gdb-cvs@sourceware.org Subject: [binutils-gdb] sim/erc32: Use int32_t as IRQ callback argument Date: Sat, 29 Oct 2022 08:15:05 +0000 (GMT) [thread overview] Message-ID: <20221029081521.995B93858D28@sourceware.org> (raw) https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=57e3eee069a54ca09d89055bf6eccff710f87ed8 commit 57e3eee069a54ca09d89055bf6eccff710f87ed8 Author: Tsukasa OI <research_trasio@irq.a4lg.com> Date: Sat Sep 24 09:54:32 2022 +0000 sim/erc32: Use int32_t as IRQ callback argument Clang generates a warning if an argument is passed to a function without prototype (zero arguments, even without (void)). Such calls are deprecated forms of indefinite arguments passing ("-Wdeprecated-non-prototype"). On the default configuration, it (somehow) doesn't cause a build failure but a warning is generated. 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. 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; set_int(level,callback,arg) -int level; -void (*callback)(); -int arg; +int32_t level; +void (*callback)(int32_t); +int32_t arg; 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) } 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 = callback; irqarr[level & 0x0f].arg = 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 { }; struct irqcell { - void (*callback) (); + void (*callback) (int32_t); int32_t arg; }; @@ -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 arg); extern void advance_time (struct pstate *sregs); extern uint32_t now (void); extern int wait_for_irq (void);
reply other threads:[~2022-10-29 8:15 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20221029081521.995B93858D28@sourceware.org \ --to=a4lg@sourceware.org \ --cc=gdb-cvs@sourceware.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).