Re: array type has incomplete element type

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

I think you can take a look at the following web page.
http://gcc.gnu.org/ml/gcc/2005-02/msg00054.html

From my own experience, I think the kernel compilation complains less
when you try to match the version of the tools as closely as possible
to what the Document specifies.
Therefore, gcc-4 must be quite new compared the kernel version that you use.

HTH.

Ilho <><
On 6/21/06, derrywang <derrywang@xxxxxxxxxx> wrote:
Hi all,

I install FC4 today, and I want to compile a clean kernel. I compile
linux kernel 2.6.11 in FC4.
Gcc version is 4.0.0 20050519 (Red Hat 4.0.0-8)
Kernel is 2.6.11-1.1369_FC4

And I got a error in include/linux/i2c.h
include/linux/i2c.h:58: error: array type has incomplete element type
include/linux/i2c.h:197: error: array type has incomplete element type

Now I have got the problem.
example code:

struct str_temp;
struct str_temp first;
struct str_temp second[2];
struct str_temp {
char cha;
int ib;
};
main(){
return;
}

when you compile these code in gcc 4.0, you would get a error.
but if you remove the array definition(struct str_temp second[2];),
the error would go away.

So, what's the problem?
why gcc 4.0 produce this error?

Thanks a lot. Forgive my poor english expression.

Derry





--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/




--
YES, JESUS LOVES YOU, TOO.
For God so loved the world that he gave his one and only Son, that
whoever believes in him shall not perish but have eternal life(John
3:16).

--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux