From owner-freebsd-bugs@FreeBSD.ORG Fri Aug 1 08:00:37 2003 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6FA7337B404 for ; Fri, 1 Aug 2003 08:00:37 -0700 (PDT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 113BC43FBD for ; Fri, 1 Aug 2003 08:00:37 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.9/8.12.9) with ESMTP id h71F0aUp048016 for ; Fri, 1 Aug 2003 08:00:36 -0700 (PDT) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.9/8.12.9/Submit) id h71F0aNX048015; Fri, 1 Aug 2003 08:00:36 -0700 (PDT) Date: Fri, 1 Aug 2003 08:00:36 -0700 (PDT) Message-Id: <200308011500.h71F0aNX048015@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org From: Bruce Evans Subject: Re: i386/41930: declaration clash for ffs() and ${CXX} X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Bruce Evans List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Aug 2003 15:00:38 -0000 The following reply was made to PR i386/41930; it has been noted by GNATS. From: Bruce Evans To: Steve Roome Cc: freebsd-gnats-submit@freebsd.org Subject: Re: i386/41930: declaration clash for ffs() and ${CXX} Date: Sat, 2 Aug 2003 00:57:36 +1000 (EST) On Thu, 31 Jul 2003, Steve Roome wrote: > Just noticed that on 4.8-STABLE I get a similar effect compiling code > with -ansi. Which is similar, possibly slightly different, but adds > weight for the argument for fixing the ffs() code. > > - Example Code --------------------------------------------------------- > > #include > #include > #include > int main() { return 1; } > > - Example Compiler Output ---------------------------------------------- > > gcc -ansi -Wall -Werror test.c > cc1: warnings being treated as errors > In file included from /usr/include/vgl.h:37, > from test.c:3: > /usr/include/machine/cpufunc.h:118: warning: static declaration for `ffs' follows non-static > > - End Example ---------------------------------------------------------- This is from namespace pollution in (it includes the kernel-only implementation-detail header and some standard headers). > This "implementation detail" might be used by a programmer using C++ > or -ansi on a C program, surely it should work ? Only if the implementation exports its detail. The implementation shouldn't do this gratuitously as in . Bruce