qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] tcg/arm: Fix compiler error caused by unused function
@ 2011-07-29 20:07 Stefan Weil
  2011-08-13  9:16 ` Stefan Weil
  0 siblings, 1 reply; 3+ messages in thread
From: Stefan Weil @ 2011-07-29 20:07 UTC (permalink / raw)
  To: QEMU Developers

Function tcg_out_addi is obviously unused and causes a compiler
error (tested with cross compilation on x86 Debian Linux):

tcg/arm/tcg-target.c:1824: error: ‘tcg_out_addi’ defined but not used

Don't remove it because it might be useful in the future,
but declare it inline. This fixes the compiler error and
is similar to other tcg targets.

Cc: Andrzej Zaborowski <balrogg@gmail.com>
Signed-off-by: Stefan Weil <weil@mail.berlios.de>
---
 tcg/arm/tcg-target.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/tcg/arm/tcg-target.c b/tcg/arm/tcg-target.c
index 93eb0f1..c94a354 100644
--- a/tcg/arm/tcg-target.c
+++ b/tcg/arm/tcg-target.c
@@ -1820,7 +1820,7 @@ static inline void tcg_out_st(TCGContext *s, TCGType type, int arg,
     tcg_out_st32(s, COND_AL, arg, arg1, arg2);
 }
 
-static void tcg_out_addi(TCGContext *s, int reg, tcg_target_long val)
+static inline void tcg_out_addi(TCGContext *s, int reg, tcg_target_long val)
 {
     if (val > 0)
         if (val < 0x100)
-- 
1.7.2.5

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] [PATCH] tcg/arm: Fix compiler error caused by unused function
  2011-07-29 20:07 [Qemu-devel] [PATCH] tcg/arm: Fix compiler error caused by unused function Stefan Weil
@ 2011-08-13  9:16 ` Stefan Weil
  2011-08-24 20:25   ` Andreas Färber
  0 siblings, 1 reply; 3+ messages in thread
From: Stefan Weil @ 2011-08-13  9:16 UTC (permalink / raw)
  To: Andrzej Zaborowski; +Cc: QEMU Developers

Am 29.07.2011 22:07, schrieb Stefan Weil:
> Function tcg_out_addi is obviously unused and causes a compiler
> error (tested with cross compilation on x86 Debian Linux):
>
> tcg/arm/tcg-target.c:1824: error: ‘tcg_out_addi’ defined but not used
>
> Don't remove it because it might be useful in the future,
> but declare it inline. This fixes the compiler error and
> is similar to other tcg targets.
>
> Cc: Andrzej Zaborowski<balrogg@gmail.com>
> Signed-off-by: Stefan Weil<weil@mail.berlios.de>
> ---
>   tcg/arm/tcg-target.c |    2 +-
>   1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/tcg/arm/tcg-target.c b/tcg/arm/tcg-target.c
> index 93eb0f1..c94a354 100644
> --- a/tcg/arm/tcg-target.c
> +++ b/tcg/arm/tcg-target.c
> @@ -1820,7 +1820,7 @@ static inline void tcg_out_st(TCGContext *s, TCGType type, int arg,
>       tcg_out_st32(s, COND_AL, arg, arg1, arg2);
>   }
>
> -static void tcg_out_addi(TCGContext *s, int reg, tcg_target_long val)
> +static inline void tcg_out_addi(TCGContext *s, int reg, tcg_target_long val)
>   {
>       if (val>  0)
>           if (val<  0x100)
>    

Ping?

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] [PATCH] tcg/arm: Fix compiler error caused by unused function
  2011-08-13  9:16 ` Stefan Weil
@ 2011-08-24 20:25   ` Andreas Färber
  0 siblings, 0 replies; 3+ messages in thread
From: Andreas Färber @ 2011-08-24 20:25 UTC (permalink / raw)
  To: Stefan Weil; +Cc: QEMU Developers

Am 13.08.2011 um 11:16 schrieb Stefan Weil:

> Am 29.07.2011 22:07, schrieb Stefan Weil:
>> Function tcg_out_addi is obviously unused and causes a compiler
>> error (tested with cross compilation on x86 Debian Linux):
>>
>> tcg/arm/tcg-target.c:1824: error: ‘tcg_out_addi’ defined but not used
>>
>> Don't remove it because it might be useful in the future,
>> but declare it inline. This fixes the compiler error and
>> is similar to other tcg targets.
>>
>> Cc: Andrzej Zaborowski<balrogg@gmail.com>
>> Signed-off-by: Stefan Weil<weil@mail.berlios.de>
>> ---
>>  tcg/arm/tcg-target.c |    2 +-
>>  1 files changed, 1 insertions(+), 1 deletions(-)
>>
>> diff --git a/tcg/arm/tcg-target.c b/tcg/arm/tcg-target.c
>> index 93eb0f1..c94a354 100644
>> --- a/tcg/arm/tcg-target.c
>> +++ b/tcg/arm/tcg-target.c
>> @@ -1820,7 +1820,7 @@ static inline void tcg_out_st(TCGContext *s,  
>> TCGType type, int arg,
>>      tcg_out_st32(s, COND_AL, arg, arg1, arg2);
>>  }
>>
>> -static void tcg_out_addi(TCGContext *s, int reg, tcg_target_long  
>> val)
>> +static inline void tcg_out_addi(TCGContext *s, int reg,  
>> tcg_target_long val)
>>  {
>>      if (val>  0)
>>          if (val<  0x100)
>>
>
> Ping?

I don't like that solution, it's not obvious that 'inline' should be  
reverted later.

GCC has __attribute__((unused)) for that purpose. It can be prepended  
on a line of its own so that it can be removed without touching the  
actual declaration.

Andreas

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-08-24 20:25 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-07-29 20:07 [Qemu-devel] [PATCH] tcg/arm: Fix compiler error caused by unused function Stefan Weil
2011-08-13  9:16 ` Stefan Weil
2011-08-24 20:25   ` Andreas Färber

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).