Date: Fri, 1 Aug 2003 08:00:36 -0700 (PDT) From: Bruce Evans <bde@zeta.org.au> To: freebsd-bugs@FreeBSD.org Subject: Re: i386/41930: declaration clash for ffs() and ${CXX} Message-ID: <200308011500.h71F0aNX048015@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
The following reply was made to PR i386/41930; it has been noted by GNATS. From: Bruce Evans <bde@zeta.org.au> To: Steve Roome <stephen_roome@pepcross.com> 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 <string.h> > #include <machine/console.h> > #include <vgl.h> > 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 <vgl.h> (it includes the kernel-only implementation-detail header <machine/cpufunc.h> 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 <vgl.h>. Bruce
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200308011500.h71F0aNX048015>