Skip to content

fix gcc-14 compile error on dhrystone: implicit-function-declaration, implicit-int

Created by: xiaoweish

When compiling dhrystone with gcc-14, there is below errors

Tue, 28 May 2024 11:55:02 INFO     GCC Version: 14.0.1

Tue, 28 May 2024 11:55:02 INFO     ../tests/riscv-tests/benchmarks/dhrystone/dhrystone_main.c: In function 'main':
../tests/riscv-tests/benchmarks/dhrystone/dhrystone_main.c:120:7: error: implicit declaration of function 'Proc_5' [-Wimplicit-function-declaration]
  120 |       Proc_5();
      |       ^~~~~~

../tests/riscv-tests/benchmarks/dhrystone/dhrystone_main.c: At top level:
../tests/riscv-tests/benchmarks/dhrystone/dhrystone_main.c:242:1: error: return type defaults to 'int' [-Wimplicit-int]
  242 | Proc_1 (Ptr_Val_Par)
      | ^~~~~~

As Porting to GCC 14 says,

For backwards compatibility, GCC 13 and earlier diagnosed use of these features as warnings only. Although these warnings have been enabled by default for many releases, experience shows that these warnings are easily ignored, resulting in difficult to diagnose bugs. In GCC 14, these issues are now reported as errors, and no output file is created, providing clearer feedback to programmers that something is wrong.

So, turn off these here.

Merge request reports

Loading