]> Git Repo - qemu.git/commitdiff
i386: avoid a write only variable
authorBlue Swirl <[email protected]>
Wed, 13 Oct 2010 18:38:08 +0000 (18:38 +0000)
committerBlue Swirl <[email protected]>
Wed, 13 Oct 2010 18:43:19 +0000 (18:43 +0000)
Compiling with GCC 4.6.0 20100925 produced warnings:
/src/qemu/target-i386/op_helper.c: In function 'switch_tss':
/src/qemu/target-i386/op_helper.c:283:53: error: variable 'new_trap' set but not used [-Werror=unused-but-set-variable]

Fix by adding a dummy cast so that the variable is not unused. Add also
pointer to docs.

Signed-off-by: Blue Swirl <[email protected]>
target-i386/op_helper.c

index ec6b3e938457cc591c7b3725732362deb0a5f796..43fbd0c778ae3b946ecf46942a7a31d939cde955 100644 (file)
@@ -349,6 +349,10 @@ static void switch_tss(int tss_selector,
         new_segs[R_GS] = 0;
         new_trap = 0;
     }
+    /* XXX: avoid a compiler warning, see
+     http://support.amd.com/us/Processor_TechDocs/24593.pdf
+     chapters 12.2.5 and 13.2.4 on how to implement TSS Trap bit */
+    (void)new_trap;
 
     /* NOTE: we must avoid memory exceptions during the task switch,
        so we make dummy accesses before */
This page took 0.02983 seconds and 4 git commands to generate.