Date: Fri, 5 Aug 2005 10:49:25 -0400 From: John Baldwin <jhb@FreeBSD.org> To: freebsd-arch@freebsd.org Cc: Craig Rodrigues <rodrigc@crodrigues.org> Subject: Re: [RFC] Kernel patches for compilation with gcc 4.0 Message-ID: <200508051049.26158.jhb@FreeBSD.org> In-Reply-To: <20050803200143.GA70735@crodrigues.org> References: <20050803200143.GA70735@crodrigues.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On Wednesday 03 August 2005 04:01 pm, Craig Rodrigues wrote: > Hi, > > I installed gcc version 4.0.2 20050721 (prerelease) [FreeBSD] > from ports and tried to compile the kernel using a LINT config file on > i386. > > I had to apply these patches: > http://people.freebsd.org/~rodrigc/fbsd.makefiles.diff.txt > > to the kernel makefile rules because "-I-" is removed from gcc 4.0, > and "-fformat-extensions" is a FreeBSD extension to GCC which is not > in the ports version of the compiler. > > I had to apply these patches to the source code to eliminate errors: > > http://people.freebsd.org/~rodrigc/fbsd.kernel.gcc40.diffs.txt > > Mostly I fixed cases like this: > > extern struct foo bar; > static struct foo bar = { }; > > In ISO C, it is illegal to define a struct with external linkage, > and then internal linkage. GCC 3.x allows it, but GCC 4.x flags it as an > error. > > Also, if you do: > static struct foo bar; > static struct foo bar = { }; > > then the -Wredundant-decls flag in the kernel makefile will issue > a warning. > > Can someone provide feedback on the kernel patches? > Thanks. It would be really nice to not have to add a bunch of (caddr_t) casts. You need to get the acpi_wakeup changes reviewed. Not saving the gdt and idt descriptors across suspend/resume would be very disastrous. I think it is a mistake to make static structures like th0 non-static to workaround -Wredundant-decls. Get gcc to fix -Wredundant-decls instead if at all possible. kern_tc.c is an example of this type of change. rtsock.c probably is, too. Why did you move MALLOC_DECLARE out of in6_var.h? -- John Baldwin <jhb@FreeBSD.org> <>< http://www.FreeBSD.org/~jhb/ "Power Users Use the Power to Serve" = http://www.FreeBSD.org
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200508051049.26158.jhb>