* [PATCH] Fix allnoconfig build with gcc4
@ 2005-09-10 20:19 mikukkon
2005-09-10 21:00 ` Linus Torvalds
0 siblings, 1 reply; 3+ messages in thread
From: mikukkon @ 2005-09-10 20:19 UTC (permalink / raw)
To: torvalds; +Cc: linux-kernel
It seems that git commit 20380731bc2897f2952ae055420972ded4cd786e breaks
allnoconfig build with gcc4:
CC init/main.o
In file included from include/linux/netdevice.h:29,
from include/net/sock.h:48,
from init/main.c:50:
include/linux/if_ether.h:114: error: array type has incomplete element type
The "normal" fix of replacing foo[] with *foo would is not trivial, but
simply removing the offending line is.
Signed-off-by: Mika Kukkonen <mikukkon@iki.fi>
Index: linux-2.6/include/linux/if_ether.h
===================================================================
--- linux-2.6.orig/include/linux/if_ether.h
+++ linux-2.6/include/linux/if_ether.h
@@ -111,7 +111,6 @@ static inline struct ethhdr *eth_hdr(con
return (struct ethhdr *)skb->mac.raw;
}
-extern struct ctl_table ether_table[];
#endif
#endif /* _LINUX_IF_ETHER_H */
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] Fix allnoconfig build with gcc4
2005-09-10 20:19 [PATCH] Fix allnoconfig build with gcc4 mikukkon
@ 2005-09-10 21:00 ` Linus Torvalds
2005-09-11 17:23 ` Mika Kukkonen
0 siblings, 1 reply; 3+ messages in thread
From: Linus Torvalds @ 2005-09-10 21:00 UTC (permalink / raw)
To: mikukkon; +Cc: linux-kernel
On Sat, 10 Sep 2005 mikukkon@iki.fi wrote:
>
> It seems that git commit 20380731bc2897f2952ae055420972ded4cd786e breaks
> allnoconfig build with gcc4:
>
> CC init/main.o
> In file included from include/linux/netdevice.h:29,
> from include/net/sock.h:48,
> from init/main.c:50:
> include/linux/if_ether.h:114: error: array type has incomplete element type
>
> The "normal" fix of replacing foo[] with *foo would is not trivial, but
> simply removing the offending line is.
>
> Signed-off-by: Mika Kukkonen <mikukkon@iki.fi>
No, this would cause a compile error if CONFIG_NET and CONFIG_SYSCTL is
enabled (because sysctl_net.c needs that declaration).
So the correct solution is apparently either one of
- always declare an empty "struct ctl_table" regardless of whether SYSCTL
is enabled or not.
This might be a good idea, since it probably allows more code to be
compiled without checking for CONFIG_SYSCTL.
- put the ether_table[] declaration inside a #ifdef CONFIG_SYSCTL.
Maybe somebody else has a stronger opinion than I do about which of these
is the right solution.
Linus
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] Fix allnoconfig build with gcc4
2005-09-10 21:00 ` Linus Torvalds
@ 2005-09-11 17:23 ` Mika Kukkonen
0 siblings, 0 replies; 3+ messages in thread
From: Mika Kukkonen @ 2005-09-11 17:23 UTC (permalink / raw)
To: Linus Torvalds; +Cc: linux-kernel
On 9/11/05, Linus Torvalds <torvalds@osdl.org> wrote:
>
>
(...)
> No, this would cause a compile error if CONFIG_NET and CONFIG_SYSCTL
> is enabled (because sysctl_net.c needs that declaration).
Ah yes. I got confused by googling which showed that there are some issues
with these declarations and gcc4 (see for example this thread:
http://gcc.gnu.org/ml/gcc/2005-02/msg00053.html).
> So the correct solution is apparently either one of
>
> - always declare an empty "struct ctl_table" regardless of whether SYSCTL
> is enabled or not.
>
> This might be a good idea, since it probably allows more code to be
> compiled without checking for CONFIG_SYSCTL.
>
> - put the ether_table[] declaration inside a #ifdef CONFIG_SYSCTL.
core_table in include/net/sock.h uses the latter option, so I'll send
you a patch
for that (with better email client).
--MiKu
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2005-09-11 17:23 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-09-10 20:19 [PATCH] Fix allnoconfig build with gcc4 mikukkon
2005-09-10 21:00 ` Linus Torvalds
2005-09-11 17:23 ` Mika Kukkonen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox