From owner-freebsd-current Thu Jan 2 21:30:54 1997 Return-Path: Received: (from root@localhost) by freefall.freebsd.org (8.8.4/8.8.4) id VAA29923 for current-outgoing; Thu, 2 Jan 1997 21:30:54 -0800 (PST) Received: from mira.net.au (eplet.mira.net.au [203.9.190.17]) by freefall.freebsd.org (8.8.4/8.8.4) with SMTP id VAA29918 for ; Thu, 2 Jan 1997 21:30:40 -0800 (PST) Received: (qmail 20612 invoked from network); 3 Jan 1997 05:30:32 -0000 Received: from melb.werple.net.au (203.9.190.18) by eplet.mira.net.au with SMTP; 3 Jan 1997 05:30:32 -0000 Received: (from uucp@localhost) by melb.werple.net.au (8.7.6/8.7.3/2) with UUCP id QAA22873; Fri, 3 Jan 1997 16:17:27 +1100 (EST) Received: (from jb@localhost) by freebsd1.cimlogic.com.au (8.7.5/8.7.3) id QAA25356; Fri, 3 Jan 1997 16:21:04 +1100 (EST) From: John Birrell Message-Id: <199701030521.QAA25356@freebsd1.cimlogic.com.au> Subject: Re: MOD_DECL in lkm.h To: bde@zeta.org.au (Bruce Evans) Date: Fri, 3 Jan 1997 16:21:03 +1100 (EST) Cc: current@freebsd.org In-Reply-To: <199701030453.PAA18846@godzilla.zeta.org.au> from Bruce Evans at "Jan 3, 97 03:53:58 pm" X-Mailer: ELM [version 2.4ME+ PL22 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-current@freebsd.org X-Loop: FreeBSD.org Precedence: bulk Bruce Evans wrote: > >Shouldn't the MOD_DECL macro in lkm.h also have: > > > >static int name ## _stat __P((struct lkm_table *lkmtp, int cmd)); \ > > > >so that the status function has a prototype defined before it is used? > > No, because it causes annoying warnings for modules that don't have a > stat function when such modules are compiled with -Wunused. Hmmm. So, when you *do* have a function, it doesn't get checked and you get a warning. And when you don't, you don't get a warning that you don't. I think that's the wrong way around. Functional code should be checked. After all, the kernel is going to call it. > Bruce > -- John Birrell CIMlogic Pty Ltd jb@cimlogic.com.au; jb@netbsd.org 119 Cecil Street Ph +61 3 9690 6900 South Melbourne Vic 3205 Fax +61 3 9690 6650 Australia Mob +61 18 353 137