From owner-freebsd-current Sun Oct 20 12:56: 6 2002 Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4646A37B404; Sun, 20 Oct 2002 12:56:05 -0700 (PDT) Received: from canning.wemm.org (canning.wemm.org [192.203.228.65]) by mx1.FreeBSD.org (Postfix) with ESMTP id B56E143E88; Sun, 20 Oct 2002 12:55:57 -0700 (PDT) (envelope-from peter@wemm.org) Received: from wemm.org (localhost [127.0.0.1]) by canning.wemm.org (Postfix) with ESMTP id 972FD2A88D; Sun, 20 Oct 2002 12:55:57 -0700 (PDT) (envelope-from peter@wemm.org) X-Mailer: exmh version 2.5 07/13/2001 with nmh-1.0.4 To: Mike Barcroft Cc: Kris Kennaway , current@FreeBSD.org Subject: Re: Conflicting declarations for ffs() In-Reply-To: <20021020094608.F81582@espresso.q9media.com> Date: Sun, 20 Oct 2002 12:55:57 -0700 From: Peter Wemm Message-Id: <20021020195557.972FD2A88D@canning.wemm.org> Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Mike Barcroft wrote: > Kris Kennaway writes: > > Take a look at: > > > > http://bento.freebsd.org/errorlogs/5-full/cqcam-0.91_1.log > > > > This port includes headers that declare the ffs() function twice: once > > with an inline version and once with a prototype. > > > > Is the bug in the application, or the headers? > > It looks like a bug in our headers. I don't see why this is a new bug > though. It looks like (which used to include) > and i386's have been defining conflicting ffs() > prototypes since at least 1999. machine/cpufunc.h is really meant to be a kernel header and isn't really meant for consumption by userland. However, it is sortof useful. In this particular case, gcc provides a respectable builtin for ffs(). We probably shouldn't be overriding it for userland with our own inline for userland. Maybe it would just be better to stick a #ifdef _KERNEL around the inline version? That should leave gcc to use the builtin and fall back to the libc version if -fno-builtin is used [or if non-gcc is used]. Cheers, -Peter -- Peter Wemm - peter@wemm.org; peter@FreeBSD.org; peter@yahoo-inc.com "All of this is for nothing if we don't go to the stars" - JMS/B5 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message