Skip to contentSkip to conversation

(Re: Fix gcc 4 warnings) error: incomplete array element type

KJ Jesse Millan 2 participants 2 messages May 19, 2005 Kernel janitors

lore
Share & tools
lore
#0 lore raw

GCC 4 is rejecting decorations like the following:

[root@sc]# cat test.c

int main()

{
        extern struct foo array_foo[];
        return;
}
[root@sc]# /usr/local/gcc4/bin/gcc test.c
test.c: In function 'main':
test.c:4: error: array type has incomplete element type

I was in the process of building kernel linux-2.6.11.10 using gcc4 when came across such a decoration (include/linux/i2c.h:58) and failed.

I am sure that this is the first of many such declarations that are scattered in the kernel.

I have found that "incomplete array element type declarations" are not supposed to be valid. However, gcc3 did not complain about them.

I some discussion on the gcc mailing list:

http://gcc.gnu.org/ml/gcc/2005-02/msg00054.html

Changing the declaration like so makes the errors go away:

int main()

{
        extern struct foo * array_foo;
        return;
}

Should I post patches that make this change as I come across them?

Signature · 10 lines
Jesse Millan
CNS Unix Team
Portland State University
Phone: (503) 725-9151
Mobile: (503) 453-0748
GPG key: www.system-calls.com/gpg.php
_______________________________________________
Kernel-janitors mailing list
[email protected]
http://lists.osdl.org/mailman/listinfo/kernel-janitors
#1 lore raw
Quoted 4 lines · Jesse Millan

GCC 4 is rejecting decorations like the following:

Should I post patches that make this change as I come across them?

I have been compiling -mm kernels with gcc-4 for a while now, and since gcc-4 errors on such thinks i don't think there are any more (since make allyesconfig is almost fine).

regards,
Benoit

_______________________________________________
Kernel-janitors mailing list
[email protected]
http://lists.osdl.org/mailman/listinfo/kernel-janitors