From 0c9c620f39e56c42802504003fd05664aba670a4 Mon Sep 17 00:00:00 2001 From: Russ Cox Date: Wed, 10 Mar 2010 14:50:33 -0800 Subject: fix type-punned pointer warnings from gcc R=rsc http://codereview.appspot.com/396042 --- src/cmd/db/format.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/cmd/db') diff --git a/src/cmd/db/format.c b/src/cmd/db/format.c index 08068e61..7a93bc5f 100644 --- a/src/cmd/db/format.c +++ b/src/cmd/db/format.c @@ -60,7 +60,7 @@ exform(int fcount, int prt, char *ifp, Map *map, int literal, int firstpass) char *fp; char c, modifier; int i; - ushort sh, *sp; + ushort sh; uchar ch, *cp; Symbol s; char buf[512]; @@ -205,7 +205,8 @@ exform(int fcount, int prt, char *ifp, Map *map, int literal, int firstpass) case 'R': if (literal) { - sp = (u16int*)(void*)˙ + u16int sp[2]; + memmove(&sp, &dot, 4); dprint("%C%C", sp[0], sp[1]); endline(); dotinc = 4; -- cgit v1.2.3