Skip to content

Commit

Permalink
tests: Squash __attrconst related warnings
Browse files Browse the repository at this point in the history
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@gmail.com>
  • Loading branch information
oohal committed Nov 14, 2019
1 parent d6fc2fb commit 0b8f5ea
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
4 changes: 2 additions & 2 deletions core/test/stubs.c
Expand Up @@ -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)
{
}

Expand Down
6 changes: 2 additions & 4 deletions hdata/test/stubs.c
Expand Up @@ -105,17 +105,15 @@ 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;
return;
}

void cpu_process_local_jobs(void);

void __attrconst cpu_process_local_jobs(void)
void cpu_process_local_jobs(void)
{
}

Expand Down

0 comments on commit 0b8f5ea

Please sign in to comment.