Skip to content

Commit 7e01b2c

Browse files
ellertpablodelara
authored andcommitted
Address type mismatch warnings on riscv64
The riscv64 dispatcher code uses the same PROVIDER_INFO macro as the aarch64 dispatcher and have the same kind of warnings during compilation: igzip/riscv64/igzip_multibinary_riscv64_dispatcher.c:39:24: warning: type of 'adler32_base' does not match original declaration [-Wlto-type-mismatch] 39 | return PROVIDER_BASIC(adler32); | ^ igzip/adler32_base.c:34:1: note: return value type mismatch 34 | adler32_base(uint32_t adler32, uint8_t *start, uint64_t length) | ^ igzip/adler32_base.c:34:1: note: type 'uint32_t' should match type 'void' igzip/adler32_base.c:34:1: note: 'adler32_base' was previously declared here This commit introduces the same correction for riscv64. Signed-off-by: Mattias Ellert <[email protected]>
1 parent 6b03bc4 commit 7e01b2c

File tree

2 files changed

+7
-22
lines changed

2 files changed

+7
-22
lines changed

igzip/riscv64/igzip_multibinary_riscv64_dispatcher.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,18 @@
2828
**********************************************************************/
2929
#include "riscv64_multibinary.h"
3030

31+
extern uint32_t
32+
adler32_rvv(uint32_t, uint8_t *, uint64_t);
33+
extern uint32_t
34+
adler32_base(uint32_t, uint8_t *, uint64_t);
35+
3136
DEFINE_INTERFACE_DISPATCHER(isal_adler32)
3237
{
3338
#if HAVE_RVV
3439
const unsigned long hwcap = getauxval(AT_HWCAP);
3540
if (hwcap & HWCAP_RV('V'))
36-
return PROVIDER_INFO(adler32_rvv);
41+
return adler32_rvv;
3742
else
3843
#endif
39-
return PROVIDER_BASIC(adler32);
44+
return adler32_base;
4045
}

include/riscv64_multibinary.h

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -107,25 +107,5 @@
107107
#define DEFINE_INTERFACE_DISPATCHER(name) \
108108
void * name##_dispatcher(void)
109109

110-
#define PROVIDER_BASIC(name) \
111-
PROVIDER_INFO(name##_base)
112-
113-
#define DO_DIGNOSTIC(x) _Pragma GCC diagnostic ignored "-W"#x
114-
#define DO_PRAGMA(x) _Pragma (#x)
115-
#define DIGNOSTIC_IGNORE(x) DO_PRAGMA(GCC diagnostic ignored #x)
116-
#define DIGNOSTIC_PUSH() DO_PRAGMA(GCC diagnostic push)
117-
#define DIGNOSTIC_POP() DO_PRAGMA(GCC diagnostic pop)
118-
119-
120-
#define PROVIDER_INFO(_func_entry) \
121-
({ DIGNOSTIC_PUSH() \
122-
DIGNOSTIC_IGNORE(-Wnested-externs) \
123-
extern void _func_entry(void); \
124-
DIGNOSTIC_POP() \
125-
_func_entry; \
126-
})
127-
128-
129-
130110
#endif /* __ASSEMBLY__ */
131111
#endif /* __RISCV_MULTIBINARY_H__ */

0 commit comments

Comments
 (0)