[Skiboot] [PATCH v2 2/2] tests: Squash __attrconst related warnings

Oliver O'Halloran oohall at gmail.com
Wed Nov 13 23:14:22 AEDT 2019


Currently we get a warning because in some of the test stub functions:

        [ HOSTCC ]  hw/test/phys-map-test.c
In file included from hw/test/phys-map-test.c:8:
hw/test/../../core/test/stubs.c:78:1: warning: ‘const’ attribute on
function returning ‘void’ [-Wattributes]
   78 | {
      | ^

I'm pretty sure we added that __attrconst to squash a warning with an
earlier GCC, then they went an added a warning for the "fix." I love
compilers.

Signed-off-by: Oliver O'Halloran <oohall at gmail.com>
---
 core/test/stubs.c  | 4 ++--
 hdata/test/stubs.c | 6 ++----
 2 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/core/test/stubs.c b/core/test/stubs.c
index 38e3d51793dd..2c2992796fb3 100644
--- a/core/test/stubs.c
+++ b/core/test/stubs.c
@@ -67,14 +67,14 @@ struct cpu_job *__cpu_queue_job(struct cpu_thread *cpu,
 	return NULL;
 }
 
-void __attrconst cpu_wait_job(struct cpu_job *job, bool free_it)
+void cpu_wait_job(struct cpu_job *job, bool free_it)
 {
 	(void)job;
 	(void)free_it;
 	return;
 }
 
-void __attrconst cpu_process_local_jobs(void)
+void cpu_process_local_jobs(void)
 {
 }
 
diff --git a/hdata/test/stubs.c b/hdata/test/stubs.c
index 1d924b6c479e..107f94811670 100644
--- a/hdata/test/stubs.c
+++ b/hdata/test/stubs.c
@@ -105,8 +105,7 @@ struct cpu_job *__cpu_queue_job(struct cpu_thread *cpu,
 }
 
 void cpu_wait_job(struct cpu_job *job, bool free_it);
-
-void __attrconst cpu_wait_job(struct cpu_job *job, bool free_it)
+void cpu_wait_job(struct cpu_job *job, bool free_it)
 {
 	(void)job;
 	(void)free_it;
@@ -114,8 +113,7 @@ void __attrconst cpu_wait_job(struct cpu_job *job, bool free_it)
 }
 
 void cpu_process_local_jobs(void);
-
-void __attrconst cpu_process_local_jobs(void)
+void cpu_process_local_jobs(void)
 {
 }
 
-- 
2.21.0



More information about the Skiboot mailing list