Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When building benchmarks/dhrystone/, -Wimplicit-int and -Wimplicit-function-declaration cause many errors #598

Closed
Heng-Zhou opened this issue Nov 18, 2024 · 4 comments

Comments

@Heng-Zhou
Copy link

I encountered errors when running make command in "Building from repository" to build the riscv-tests repo:

....../riscv-tests/benchmarks/dhrystone/dhrystone.c:20:1: error: return type defaults to 'int' [-Wimplicit-int]
   20 | Proc_6 (Enum_Val_Par, Enum_Ref_Par)
      | ^~~~~~
....../riscv-tests/benchmarks/dhrystone/dhrystone.c: In function 'Proc_6':
....../riscv-tests/benchmarks/dhrystone/dhrystone.c:29:9: error: implicit declaration of function 'Func_3' [-Wimplicit-function-declaration]
   29 |   if (! Func_3 (Enum_Val_Par))
      |         ^~~~~~
....../riscv-tests/benchmarks/dhrystone/dhrystone.c: At top level:
....../riscv-tests/benchmarks/dhrystone/dhrystone.c:54:1: error: return type defaults to 'int' [-Wimplicit-int]
   54 | Proc_7 (Int_1_Par_Val, Int_2_Par_Val, Int_Par_Ref)
      | ^~~~~~

Similar errors can also be found at many other places of dhrystone.c and dhrystone_main.c. Can you please help me fix this issue? Thank you.

@Heng-Zhou
Copy link
Author

Heng-Zhou commented Nov 18, 2024

Just saw the fix here: master...pratikkedar:riscv-tests:pratik-test

Can the unit tests team please apply the fix as soon as possible? Thanks a lot.

@aswaterman
Copy link
Collaborator

No. Messing with the dhrystone benchmark source code is not a good idea, even if the changes are seemingly benign. Better to alter the Makefile to suppress the errors. It looks like #587 chose that approach; I merged it, so I'll close this PR as resolved.

@Heng-Zhou
Copy link
Author

This problem stems from bad C/C++ coding style in dhrystone.c and dhrystone_main.c, not from missing of compiling flags. If there is any mess due to the fix, it is the mess of the dhrystone source codes, which are exactly what we should fix.

@aswaterman
Copy link
Collaborator

I know that the archaic style of the Dhrystone source code is the problem. But benchmark results are not valid if the source code is altered. Anyway, the problem has been worked around, so we should consider this issue resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants