From owner-freebsd-arch@FreeBSD.ORG Fri Aug 5 14:49:14 2005 Return-Path: X-Original-To: freebsd-arch@freebsd.org Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 49C1016A41F for ; Fri, 5 Aug 2005 14:49:14 +0000 (GMT) (envelope-from jhb@FreeBSD.org) Received: from mv.twc.weather.com (mv.twc.weather.com [65.212.71.225]) by mx1.FreeBSD.org (Postfix) with ESMTP id C74C943D46 for ; Fri, 5 Aug 2005 14:49:13 +0000 (GMT) (envelope-from jhb@FreeBSD.org) Received: from [10.50.40.201] (Not Verified[65.202.103.25]) by mv.twc.weather.com with NetIQ MailMarshal (v6, 0, 3, 8) id ; Fri, 05 Aug 2005 11:03:55 -0400 From: John Baldwin To: freebsd-arch@freebsd.org Date: Fri, 5 Aug 2005 10:49:25 -0400 User-Agent: KMail/1.8 References: <20050803200143.GA70735@crodrigues.org> In-Reply-To: <20050803200143.GA70735@crodrigues.org> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200508051049.26158.jhb@FreeBSD.org> Cc: Craig Rodrigues Subject: Re: [RFC] Kernel patches for compilation with gcc 4.0 X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Aug 2005 14:49:14 -0000 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 <>< http://www.FreeBSD.org/~jhb/ "Power Users Use the Power to Serve" = http://www.FreeBSD.org