diff options
author | Tsukasa OI <research_trasio@irq.a4lg.com> | 2022-09-24 09:49:42 +0000 |
---|---|---|
committer | Tsukasa OI <research_trasio@irq.a4lg.com> | 2022-10-29 08:13:15 +0000 |
commit | e47530f72f587550b1ff2f2adcfa4f64ec702d82 (patch) | |
tree | 44d9c2d25efee2b407f1f64f9cc7aa9acbf2611a /sim/erc32/func.c | |
parent | dc4e697f2fec232cecfd1d162365ce836c785369 (diff) | |
download | gdb-e47530f72f587550b1ff2f2adcfa4f64ec702d82.zip gdb-e47530f72f587550b1ff2f2adcfa4f64ec702d82.tar.gz gdb-e47530f72f587550b1ff2f2adcfa4f64ec702d82.tar.bz2 |
sim/erc32: Use int32_t as event 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 causes a build failure (unless
"--disable-werror" is specified).
To fix that, this commit makes struct evcell to use int32_t as a callback
(cfunc) argument of an event. int32_t is chosen because "event" function
accepts "int32_t arg".
Diffstat (limited to 'sim/erc32/func.c')
-rw-r--r-- | sim/erc32/func.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/sim/erc32/func.c b/sim/erc32/func.c index af92c9f..85d3c0c 100644 --- a/sim/erc32/func.c +++ b/sim/erc32/func.c @@ -298,7 +298,7 @@ disp_reg(struct pstate *sregs, char *reg) #ifdef ERRINJ void -errinj (void) +errinj (int32_t arg ATTRIBUTE_UNUSED) { int err; @@ -825,7 +825,7 @@ dis_mem(uint32_t addr, uint32_t len, struct disassemble_info *info) /* Add event to event queue */ void -event(void (*cfunc) (), int32_t arg, uint64_t delta) +event(void (*cfunc) (int32_t), int32_t arg, uint64_t delta) { struct evcell *ev1, *evins; @@ -887,8 +887,8 @@ advance_time(struct pstate *sregs) { struct evcell *evrem; - void (*cfunc) (); - uint32_t arg; + void (*cfunc) (int32_t); + int32_t arg; uint64_t endtime; #ifdef STAT @@ -926,7 +926,7 @@ int wait_for_irq(void) { struct evcell *evrem; - void (*cfunc) (); + void (*cfunc) (int32_t); int32_t arg; uint64_t endtime; |