diff mbox series

[01/51] stubs: Remove __attrconst annotation

Message ID 20190215065708.6086-2-andrew@aj.id.au
State Changes Requested
Headers show
Series ipmi-hiomap: Tests and fixes for event handling | expand

Commit Message

Andrew Jeffery Feb. 15, 2019, 6:56 a.m. UTC
`make check` with gcc 8.2.0 (Ubuntu 8.2.0-7ubuntu1) produces the
following warnings:

    [ HOSTCC ]  core/test/stubs.c
    core/test/stubs.c:80:1: warning: ‘const’ attribute on function returning
    ‘void’ [-Wattributes]
    {
    ^
    core/test/stubs.c:87:1: warning: ‘const’ attribute on function returning
    ‘void’ [-Wattributes]
    {
    ^
    [ HOSTCC ]  hdata/test/stubs.c
    hdata/test/stubs.c:122:1: warning: ‘const’ attribute on function
    returning ‘void’ [-Wattributes]
    {
    ^
    hdata/test/stubs.c:131:1: warning: ‘const’ attribute on function
    returning ‘void’ [-Wattributes]
    {
    ^

Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
---
 core/test/stubs.c  | 4 ++--
 hdata/test/stubs.c | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

Comments

Stewart Smith Feb. 18, 2019, 12:58 a.m. UTC | #1
Andrew Jeffery <andrew@aj.id.au> writes:
> `make check` with gcc 8.2.0 (Ubuntu 8.2.0-7ubuntu1) produces the
> following warnings:
>
>     [ HOSTCC ]  core/test/stubs.c
>     core/test/stubs.c:80:1: warning: ‘const’ attribute on function returning
>     ‘void’ [-Wattributes]
>     {

As discussed in chat, I'm not convinced the could-be-const attribute
warning isn't just a pain in the arse that seems to vary based on GCC
version so much that having it be Werror is just a source of pain.

Maybe have it no-error or something?
Andrew Jeffery Feb. 18, 2019, 2:38 a.m. UTC | #2
On Mon, 18 Feb 2019, at 11:28, Stewart Smith wrote:
> Andrew Jeffery <andrew@aj.id.au> writes:
> > `make check` with gcc 8.2.0 (Ubuntu 8.2.0-7ubuntu1) produces the
> > following warnings:
> >
> >     [ HOSTCC ]  core/test/stubs.c
> >     core/test/stubs.c:80:1: warning: ‘const’ attribute on function returning
> >     ‘void’ [-Wattributes]
> >     {
> 
> As discussed in chat, I'm not convinced the could-be-const attribute
> warning isn't just a pain in the arse that seems to vary based on GCC
> version so much that having it be Werror is just a source of pain.
> 
> Maybe have it no-error or something?

Yeah, I'll hack something up to avoid both warnings.
diff mbox series

Patch

diff --git a/core/test/stubs.c b/core/test/stubs.c
index 66252f8a1e92..0e80e057d1e4 100644
--- a/core/test/stubs.c
+++ b/core/test/stubs.c
@@ -76,14 +76,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 ab6e2cec1344..f7b1da105e0e 100644
--- a/hdata/test/stubs.c
+++ b/hdata/test/stubs.c
@@ -118,7 +118,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;
@@ -127,7 +127,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)
 {
 }