OSDN Git Service

[GCC4] fix build error in arch/alpha/math-emu/math.c
authorWilly Tarreau <w@1wt.eu>
Sun, 5 Nov 2006 17:26:50 +0000 (18:26 +0100)
committerWilly Tarreau <w@1wt.eu>
Sun, 19 Nov 2006 17:02:11 +0000 (18:02 +0100)
This patch fixes this error with gcc 4 on alpha :

gcc-4.1 -D__KERNEL__ -I/data/git/public/linux-2.4/include -Wall -Wstrict-prototypes -Wno-trigraphs -O2 -fno-strict-aliasing -fno-common -fno-builtin-sprintf -fomit-frame-pointer -Wno-pointer-sign -pipe -mno-fp-regs -ffixed-8 -mcpu=ev6 -Wa,-mev6   -nostdinc -iwithprefix include -DKBUILD_BASENAME=math  -c -o math.o math.c
math.c: In function 'alpha_fp_emul':
math.c:204: warning: right shift count is negative
math.c:204: warning: left shift count >= width of type
math.c:220: warning: left shift count is negative
math.c:238: warning: statement with no effect
math.c:258: error: invalid lvalue in assignment
math.c:258: warning: right shift count >= width of type
math.c:258: warning: right shift count >= width of type
math.c:262: error: invalid lvalue in assignment
math.c:262: warning: right shift count >= width of type
math.c:262: warning: right shift count >= width of type
math.c:270: warning: statement with no effect
math.c:270: warning: statement with no effect
math.c:270: warning: statement with no effect
math.c:277: warning: statement with no effect
math.c:277: warning: statement with no effect
math.c:277: warning: statement with no effect

arch/alpha/math-emu/math.c

index 0dfa85b..0104ae6 100644 (file)
@@ -255,11 +255,11 @@ alpha_fp_emul (unsigned long pc)
                        goto done_d;
 
                case FOP_FNC_CVTxS:
-                       FP_FROM_INT_S(SR, ((long)vb), 64, long);
+                       FP_FROM_INT_S(SR, (*(long*)&vb), 64, long);
                        goto pack_s;
 
                case FOP_FNC_CVTxT:
-                       FP_FROM_INT_D(DR, ((long)vb), 64, long);
+                       FP_FROM_INT_D(DR, (*(long*)&vb), 64, long);
                        goto pack_d;
                }
                goto bad_insn;