From owner-freebsd-bugs Thu Oct 3 4:30: 7 2002 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 72ECC37B404 for ; Thu, 3 Oct 2002 04:30:05 -0700 (PDT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id C880B43E6A for ; Thu, 3 Oct 2002 04:30:04 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.6/8.12.6) with ESMTP id g93BU4Co084242 for ; Thu, 3 Oct 2002 04:30:04 -0700 (PDT) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.6/8.12.6/Submit) id g93BU4nq084241; Thu, 3 Oct 2002 04:30:04 -0700 (PDT) Date: Thu, 3 Oct 2002 04:30:04 -0700 (PDT) Message-Id: <200210031130.g93BU4nq084241@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org Cc: From: Giorgos Keramidas Subject: Re: kern/43616: static-ize some functions in sys/net/zlib.c Reply-To: Giorgos Keramidas Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org The following reply was made to PR kern/43616; it has been noted by GNATS. From: Giorgos Keramidas To: Matt Emmerton Cc: bug-followup@freebsd.org Subject: Re: kern/43616: static-ize some functions in sys/net/zlib.c Date: Thu, 3 Oct 2002 14:19:53 +0300 On 2002-10-03 00:28, Matt Emmerton wrote: > > PHK's JKH TODO List - kernel orphan symbol review > > This patch makes some symbols in net/zlib.c static as they > don't need to be visible outside of this module. The answer is probably to ignore zlib and replace it with something better. The zlib code (both the one in the kernel, and the one distributed as zlib-1.0.4, where the kernel version comes from) is fugly in too many places to be listed in a single mail followup. For the past few days, I've been trying to read through the tangle of C source that is zlib-1.0.4.tar.gz and keep notes for the following things: - Generic z-library interface. - Code that implements various compression formats. The best thing to do in zlib code, imho, would be to kill the dreaded library by replacing it with another, BSD licensed, replacement. I'm already started towards trying to make something like this. There are many evil things in the source of zlib, but the most notable one is the fact that the liberal style of writing has caused errors like the following to appear in crucial places, like the zlib.h header (which is used by almost *all* the other headers): : ZEXTERN const char * ZEXPORT zlibVersion OF((void)); : /* The application can compare zlibVersion and ZLIB_VERSION for : * consistency. : ... : */ : : /* : ZEXTERN int ZEXPORT deflateInit OF((z_streamp strm, int level)); : : Initializes the internal stream state for compression. The fields : ... : */ Note how the second function is not prototyped, because it's prototype is commented out. This bug is present in today's -current, along with many other nearby silliness caused by zlib.h and friends :( Giorgos. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message