linux-mips
[Top] [All Lists]

Compiler problems with zero-length array in the middle of a struct

To: Ralf Baechle <ralf@linux-mips.org>, linux-mips@linux-mips.org
Subject: Compiler problems with zero-length array in the middle of a struct
From: Carsten Langgaard <carstenl@mips.com>
Date: Thu, 05 Dec 2002 11:47:26 +0100
Original-recipient: rfc822;linux-mips@linux-mips.org
Sender: linux-mips-bounce@linux-mips.org
Some compiler reject a zero-length array in the middle of a structure,
and report it as an error.
So could we please redo the change, that has recently been done to
include/linux/raid/md_p.h (see patch below).

/Carsten



--
_    _ ____  ___   Carsten Langgaard   Mailto:carstenl@mips.com
|\  /|||___)(___   MIPS Denmark        Direct: +45 4486 5527
| \/ |||    ____)  Lautrupvang 4B      Switch: +45 4486 5555
  TECHNOLOGIES     2750 Ballerup       Fax...: +45 4486 5556
                   Denmark             http://www.mips.com


Index: include/linux/raid/md_p.h
===================================================================
RCS file: /home/cvs/linux/include/linux/raid/md_p.h,v
retrieving revision 1.3
diff -u -r1.3 md_p.h
--- include/linux/raid/md_p.h   28 Nov 2000 03:59:04 -0000      1.3
+++ include/linux/raid/md_p.h   5 Dec 2002 10:40:55 -0000
@@ -151,10 +151,12 @@
         */
        mdp_disk_t disks[MD_SB_DISKS];
 
+#if MD_SB_RESERVED_WORDS
        /*
         * Reserved
         */
        __u32 reserved[MD_SB_RESERVED_WORDS];
+#endif
 
        /*
         * Active descriptor
<Prev in Thread] Current Thread [Next in Thread>