linux-mips
[Top] [All Lists]

Re: Kernel compiler error : flexible array member not at end of struct

To: Doug Kehn <rdkehn@yahoo.com>
Subject: Re: Kernel compiler error : flexible array member not at end of struct
From: Chris Dearman <chris@mips.com>
Date: Tue, 04 Nov 2003 10:40:10 +0000
Cc: linux-mips@linux-mips.org
In-reply-to: <20031104054130.12392.qmail@web12008.mail.yahoo.com>
Organization: MIPS Technologies (UK) Ltd
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <20031104054130.12392.qmail@web12008.mail.yahoo.com>
Sender: linux-mips-bounce@linux-mips.org
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.5b) Gecko/20030827
Doug Kehn wrote:
I am using gcc version 2.96-mips3264-000710 (from
sdelinux-5.01-4eb.i386.rpm).  The kernel is,
obviously, 2.4.21 (from linux-mips.org).  uclibc is
version 0.9.21.

I have seen one or two other posting related to this
same error.  However, I was unable to find any
suggested resoltions.  Does anyone know of a solution
to this compile error?

There is an updated version of the compiler that handles zero-length arrays in structures correctly. See ftp://ftp.mips.com/pub/tools/software/sde-for-linux/

  Alternatively you could apply the attached patch

        Chris

--
Chris Dearman          The Fruit Farm, Ely Road    voice +44 1223 706206
MIPS Technologies (UK) Chittering, Cambs, CB5 9PH  fax   +44 1223 706250
Index: md_p.h
===================================================================
RCS file: linux-2.4.18/include/linux/raid/md_p.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- md_p.h      4 Mar 2002 11:13:33 -0000       1.1
+++ md_p.h      8 Nov 2002 13:09:02 -0000       1.2
@@ -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>