From d1a2d83e00e5037f4354692c70a5be085f3c147c Mon Sep 17 00:00:00 2001 From: Alasdair Date: Tue, 21 May 2024 00:43:16 +0100 Subject: csim: Fix C23 compatability warning The plat_get_16_random_bits was missing its unit argument, which produces the following warning: ``` generated_definitions/c/riscv_model_RV64.c:28041:34: warning: passing arguments to 'plat_get_16_random_bits' without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype] zseed = plat_get_16_random_bits(UNIT); ``` This commit adds the appropriate argument to the function in the C simulator --- c_emulator/riscv_platform.c | 2 +- c_emulator/riscv_platform.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/c_emulator/riscv_platform.c b/c_emulator/riscv_platform.c index 5b98528..2fdb63f 100644 --- a/c_emulator/riscv_platform.c +++ b/c_emulator/riscv_platform.c @@ -108,7 +108,7 @@ mach_bits plat_rom_size(unit u) } // Provides entropy for the scalar cryptography extension. -mach_bits plat_get_16_random_bits() +mach_bits plat_get_16_random_bits(unit u) { return rv_16_random_bits(); } diff --git a/c_emulator/riscv_platform.h b/c_emulator/riscv_platform.h index 3cc6f02..341bd59 100644 --- a/c_emulator/riscv_platform.h +++ b/c_emulator/riscv_platform.h @@ -26,7 +26,7 @@ mach_bits plat_rom_base(unit); mach_bits plat_rom_size(unit); // Provides entropy for the scalar cryptography extension. -mach_bits plat_get_16_random_bits(); +mach_bits plat_get_16_random_bits(unit); mach_bits plat_clint_base(unit); mach_bits plat_clint_size(unit); -- cgit v1.1