Skip to contentSkip to conversation

target-sh4/op.c:597: warning: cast to pointer from integer of different size

Qemu-devel Jan Kiszka 1 participant 2 messages Jun 23, 2008 – Jul 13, 2008

lore
Share & tools
lore

Jan Kiszka

author
#0 lore raw

The warning above pointed me to some strange code. I guess this was originally indented:

target-sh4/op.c +2 -2
Index: qemu/target-sh4/op.c
===================================================================
@@ -594,8 +594,8 @@ void OPPROTO op_shlr16_Rn(void)
 
 void OPPROTO op_tasb_rN(void)
 {
-    cond_t(*(int8_t *) env->gregs[PARAM1] == 0);
-    *(int8_t *) env->gregs[PARAM1] |= 0x80;
+    cond_t((env->gregs[PARAM1] & 0xff) == 0);
+    *(int8_t *) &env->gregs[PARAM1] |= 0x80;
     RETURN();
 }
 
author
#1 lore raw
Quoted 10 lines · Jan Kiszka

The warning above pointed me to some strange code. I guess this was originally indented:

Index: qemu/target-sh4/op.c
===================================================================

target-sh4/op.c void OPPROTO op_shlr16_Rn(void) · line 601

Quoted 10 lines
target-sh4/op.c +2 -2
@@ -594,8 +594,8 @@ void OPPROTO op_shlr16_Rn(void)
 
 void OPPROTO op_tasb_rN(void)
 {
-    cond_t(*(int8_t *) env->gregs[PARAM1] == 0);
-    *(int8_t *) env->gregs[PARAM1] |= 0x80;
+    cond_t((env->gregs[PARAM1] & 0xff) == 0);
+    *(int8_t *) &env->gregs[PARAM1] |= 0x80;
     RETURN();
 }
 

Problem still exists, patch still applies - does anyone take care of this arch?

Jan