Skip to contentSkip to conversation

tcg/arm: Fix compiler error caused by unused function

PATCH In review Stefan Weil 2 participants 3 messages Jul 29, 2011 – Aug 24, 2011

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tcg/arm: Fix compiler error caused by unused function

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 <[email protected]>
---
 tcg/arm/tcg-target.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
tcg/arm/tcg-target.c +1 -1
index 93eb0f1..c94a354 100644
@@ -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)
Signature · 1 line
1.7.2.5
#1 lore raw

Am 29.07.2011 22:07, schrieb Stefan Weil:

Quoted 21 lines

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<[email protected]>
---
  tcg/arm/tcg-target.c |    2 +-
  1 files changed, 1 insertions(+), 1 deletions(-)
tcg/arm/tcg-target.c +0 -0
index 93eb0f1..c94a354 100644

tcg/arm/tcg-target.c static inline void tcg_out_st(TCGContext *s, TCGType type, int arg, · line 1826

Quoted 8 lines
tcg/arm/tcg-target.c +1 -1
@@ -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?

#2 lore raw

Am 13.08.2011 um 11:16 schrieb Stefan Weil:

Quoted 25 lines

Am 29.07.2011 22:07, schrieb Stefan Weil:

Quoted 24 lines

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<[email protected]>
---
 tcg/arm/tcg-target.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
tcg/arm/tcg-target.c +0 -0
index 93eb0f1..c94a354 100644
@@ -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);
 }
 
Quoted 10 lines
Quoted 8 lines
tcg/arm/tcg-target.c +1 -1
-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