This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx-apps.git


The following commit(s) were added to refs/heads/master by this push:
     new 8ed046e2d apps/benchmarks/dhrystone: Fix compilation errors
8ed046e2d is described below

commit 8ed046e2d6e3dbff9853f1eadec5fafa2dfc41c1
Author: wangming9 <[email protected]>
AuthorDate: Mon Apr 8 17:24:21 2024 +0800

    apps/benchmarks/dhrystone: Fix compilation errors
    
    Error details:
    dhrystone/v2.2/dry.c:714:3: error: 'Int_2_Loc' may be used uninitialized 
[-Werror=maybe-uninitialized]
      714 |   fprintf (stderr, "Int_2_Loc:           %d\n", Int_2_Loc);
          |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    dhrystone/v2.2/dry.c:543:25: note: 'Int_2_Loc' was declared here
      543 |   REG   One_Fifty       Int_2_Loc;
          |                         ^~~~~~~~~
    
    Signed-off-by: wangming9 <[email protected]>
    Signed-off-by: lipengfei28 <[email protected]>
---
 benchmarks/dhrystone/CMakeLists.txt | 5 ++++-
 benchmarks/dhrystone/Makefile       | 1 +
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/benchmarks/dhrystone/CMakeLists.txt 
b/benchmarks/dhrystone/CMakeLists.txt
index aec5b111f..dd503077a 100644
--- a/benchmarks/dhrystone/CMakeLists.txt
+++ b/benchmarks/dhrystone/CMakeLists.txt
@@ -44,7 +44,10 @@ if(CONFIG_BENCHMARK_DHRYSTONE)
     endif()
   endif()
 
-  set(CFLAGS -DMSC_CLOCK)
+  set(CFLAGS
+      -DMSC_CLOCK -Wno-maybe-uninitialized -Wno-implicit-int
+      -Wno-strict-prototypes -Wno-implicit-function-declaration
+      -Wno-return-type)
   set(SRCS dhrystone/v2.2/dry.c dhrystone/v2.1/dhry_2.c)
 
   nuttx_add_application(
diff --git a/benchmarks/dhrystone/Makefile b/benchmarks/dhrystone/Makefile
index db2e16eab..17f0912d4 100644
--- a/benchmarks/dhrystone/Makefile
+++ b/benchmarks/dhrystone/Makefile
@@ -29,6 +29,7 @@ MODULE    = $(CONFIG_BENCHMARK_DHRYSTONE)
 
 CFLAGS   += -DMSC_CLOCK -Wno-implicit-int -Wno-strict-prototypes
 CFLAGS   += -Wno-implicit-function-declaration -Wno-return-type
+CFLAGS   += -Wno-maybe-uninitialized
 
 CSRCS    += dhrystone/v2.1/dhry_2.c
 MAINSRC   = dhrystone/v2.2/dry.c

Reply via email to