linux-mips
[Top] [All Lists]

[PATCH]: you can't use p and p++ without a secuence point

To: Ralf Baechle <ralf@linux-mips.org>, mipslist <linux-mips@linux-mips.org>
Subject: [PATCH]: you can't use p and p++ without a secuence point
From: Juan Quintela <quintela@mandrakesoft.com>
Date: 19 Dec 2002 12:03:29 +0100
Original-recipient: rfc822;linux-mips@linux-mips.org
Sender: linux-mips-bounce@linux-mips.org
Hi
        using p & p++ without a sequence point in the middle is
        undefined behaviour.  Once there fix the casts also.
        and change == to = as normally == means identity, not
        asignation :(

Later, Juan.

Index: arch/mips/lib/dump_tlb.c
===================================================================
RCS file: /home/cvs/linux/arch/mips/lib/dump_tlb.c,v
retrieving revision 1.8.2.6
diff -u -r1.8.2.6 dump_tlb.c
--- arch/mips/lib/dump_tlb.c    18 Dec 2002 22:47:37 -0000      1.8.2.6
+++ arch/mips/lib/dump_tlb.c    19 Dec 2002 10:38:02 -0000
@@ -225,9 +226,7 @@
 
        for(i=0;i<8;i++)
        {
-               printk("*%08lx == %08lx, ",
-                      (unsigned long)p, (unsigned long)*p++);
-               printk("*%08lx == %08lx\n",
-                      (unsigned long)p, (unsigned long)*p++);
+               printk("*%8p = %08lx, ", p, *p); p++;
+               printk("*%8p = %08lx\n", p, *p); p++;
        }
 }


-- 
In theory, practice and theory are the same, but in practice they 
are different -- Larry McVoy

<Prev in Thread] Current Thread [Next in Thread>
  • [PATCH]: you can't use p and p++ without a secuence point, Juan Quintela <=