From owner-freebsd-current Fri Dec 8 00:52:56 1995 Return-Path: owner-current Received: (from root@localhost) by freefall.freebsd.org (8.7.3/8.7.3) id AAA11251 for current-outgoing; Fri, 8 Dec 1995 00:52:56 -0800 (PST) Received: from godzilla.zeta.org.au (godzilla.zeta.org.au [203.2.228.19]) by freefall.freebsd.org (8.7.3/8.7.3) with SMTP id AAA11240 for ; Fri, 8 Dec 1995 00:52:41 -0800 (PST) Received: (from bde@localhost) by godzilla.zeta.org.au (8.6.9/8.6.9) id TAA18565; Fri, 8 Dec 1995 19:47:22 +1100 Date: Fri, 8 Dec 1995 19:47:22 +1100 From: Bruce Evans Message-Id: <199512080847.TAA18565@godzilla.zeta.org.au> To: current@FreeBSD.ORG, scrappy@hub.org Subject: Re: cd /usr/src/lib; make depend...Fails Sender: owner-current@FreeBSD.ORG Precedence: bulk >===> libmytinfo >cc -O -Wall -I/usr/src/lib/libmytinfo -c /usr/src/lib/libmytinfo/readcaps.c -o readcaps.o >In file included from /usr/src/lib/libmytinfo/defs.h:32, > from /usr/src/lib/libmytinfo/readcaps.c:13: >/usr/include/stdlib.h:42: warning: empty declaration >In file included from /usr/src/lib/libmytinfo/readcaps.c:13: >/usr/src/lib/libmytinfo/defs.h:194: conflicting types for `sys_errlist' >/usr/include/stdio.h:244: previous declaration of `sys_errlist' >*** Error code 1 >... > The offending code is: >#if __FreeBSD__ != 2 >extern char *sys_errlist[]; >#endif The compiler is expected to define __FreeBSD__ as 2. If you use gcc-2.7.x, then you have to change the bogus definition of __FreeBSD__ in the supplied freebsd.h, which is for FreeBSD-1.1 or earlier. It is bogus for the compiler to define the OS version, as this example shows - the correct declaration of sys_errlist[] depends on the OS version, not on the compiler. > Since the code *is* for current, is there any reason that this >has been kept in defs.h? I've commented out that section of code, and >it compiles through... I think it is so that diffs can be sent to the central maintainer of the sources. Bogus tests of the form `#if _FOO_OS == 2 || ...' might be acceptable to the central maintainer, but ones that #include a magic header to get a magic #define aren't, because the magic header might not exist. > Now, the first error, in stdlib.h:42 still comes up... >cc -O -Wall -I/usr/src/lib/libmytinfo -c /usr/src/lib/libmytinfo/readcaps.c -o readcaps.o >In file included from /usr/src/lib/libmytinfo/defs.h:32, > from /usr/src/lib/libmytinfo/readcaps.c:13: >/usr/include/stdlib.h:42: warning: empty declaration >cc -O -Wall -I/usr/src/lib/libmytinfo -o mkcaplist /usr/src/lib/libmytinfo/mkcaplist.c readcaps.o >In file included from /usr/src/lib/libmytinfo/defs.h:32, > from /usr/src/lib/libmytinfo/mkcaplist.c:15: >/usr/include/stdlib.h:42: warning: empty declaration > The offending code here, is: >#ifdef _BSD_SIZE_T_ >typedef _BSD_SIZE_T_ size_t; >#undef _BSD_SIZE_T_ >#endif > This one, someone is going to have to explain to me... > if _BSD_SIZE_T_ is defined, redefine it and then undefine >it again? If this is right, why? If i is wrong, my first guess would >be that it is backwards, in that the #undef should come before the >typedef... If you use gcc-2.7.x, then you have to throw out or fix the supplied stdarg.h, which takes over 50 lines to define _BSD_SIZE_T_ incorrectly. Bruce