From owner-freebsd-arch@FreeBSD.ORG Fri Aug 5 17:06:50 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 0C3DF16A41F for ; Fri, 5 Aug 2005 17:06:50 +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 9708543D46 for ; Fri, 5 Aug 2005 17:06:49 +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 13:21:30 -0400 From: John Baldwin To: freebsd-arch@freebsd.org Date: Fri, 5 Aug 2005 13:07:18 -0400 User-Agent: KMail/1.8 References: <20050803200143.GA70735@crodrigues.org> <200508051049.26158.jhb@FreeBSD.org> <20050805162234.GA96585@crodrigues.org> In-Reply-To: <20050805162234.GA96585@crodrigues.org> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200508051307.19261.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 17:06:50 -0000 On Friday 05 August 2005 12:22 pm, Craig Rodrigues wrote: > On Fri, Aug 05, 2005 at 10:49:25AM -0400, John Baldwin wrote: > > You need to get the acpi_wakeup changes reviewed. Not saving the gdt and > > idt descriptors across suspend/resume would be very disastrous. > > I sent a separate e-mail to njl@ and marks@ about the acpi_wakeup patch. > The patch was suggested to me by kan@. He suggested that > I remove the static variables which clashed with the global variables > of the same name, and to remove asm calls which saved them in acpi_wakeup.c Ok. I thought I had recalled something about that but wasn't sure. > > 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. > > This behavior in GCC seems to have been there for a long time > (I can reproduce it with 2.95, 3.4, and 4.0). I can ask the GCC people > about this. The other alternative is to remove -Wredundant-decls > from the kernel Makefiles. I asked why we use -Wredundant-decls, because > it seems to warn against legal C code: > > http://lists.freebsd.org/pipermail/freebsd-current/2005-August/053708.html > > I'm not enough of a C guru to know.... Ok, given that, I'd rather remove -Wredundant_decls than break perfectly legal code. It would be nice if there was a -Wredundant_decls_that_actually_works > > Why did you move MALLOC_DECLARE out of in6_var.h? > > Because I got this compiler error in in.c : > > gcc40 -c -O -pipe -Wall -Wredundant-decls -Wnested-externs > -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Winline > -Wcast-qual -std=c99 -g -nostdinc -I. -I../../.. > -I../../../contrib/dev/acpica -I../../../contrib/altq > -I../../../contrib/ipfilter -I../../../contrib/pf > -I../../../contrib/dev/ath -I../../../contrib/dev/ath/freebsd > -I../../../contrib/ngatm -I../../../dev/twa -D_KERNEL -include opt_global.h > -fno-common -finline-limit=8000 --param inline-unit-growth=100 --param > large-function-growth=1000 -mpreferred-stack-boundary=2 -mno-mmx > -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 -ffreestanding -Werror > ../../../netinet/in.c ../../../netinet/in.c:54: error: static declaration > of 'M_IPMADDR' follows non-static declaration > ../../../netinet6/in6_var.h:479: error: previous declaration of 'M_IPMADDR' > was here *** Error code 1 Looks like this is indicative of another error. There are two different M_IPMADDR malloc buckets. The IPv6 one should probably be called M_IP6MADDR instead. netinet/in.c:static MALLOC_DEFINE(M_IPMADDR, "in_multi", "internet multicast address"); netinet6/in6.c:MALLOC_DEFINE(M_IPMADDR, "in6_multi", "internet multicast address"); -- John Baldwin <>< http://www.FreeBSD.org/~jhb/ "Power Users Use the Power to Serve" = http://www.FreeBSD.org