NetBSD Problem Report #43348
From www@NetBSD.org Mon May 24 13:45:05 2010
Return-Path: <www@NetBSD.org>
Received: from mail.netbsd.org (mail.netbsd.org [204.152.190.11])
by www.NetBSD.org (Postfix) with ESMTP id 24A7063B879
for <gnats-bugs@gnats.NetBSD.org>; Mon, 24 May 2010 13:45:05 +0000 (UTC)
Message-Id: <20100524134504.BCBA963B873@www.NetBSD.org>
Date: Mon, 24 May 2010 13:45:04 +0000 (UTC)
From: fujiyosi.ncl@gmail.com
Reply-To: fujiyosi.ncl@gmail.com
To: gnats-bugs@NetBSD.org
Subject: driver(9) man page has strange examples
X-Send-Pr-Version: www-1.0
>Number: 43348
>Category: misc
>Synopsis: driver(9) man page has strange examples
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: misc-bug-people
>State: open
>Class: doc-bug
>Submitter-Id: net
>Arrival-Date: Mon May 24 13:50:00 +0000 2010
>Last-Modified: Mon May 24 17:20:02 +0000 2010
>Originator: Takeshi Fujiyoshi
>Release: NetBSD 5.99.29
>Organization:
>Environment:
>Description:
driver(9) man page has strange examples of foo_cdevsw and foo_bdevsw.
const struct cdevsw foo_cdevsw {
int (*d_open)(dev_t, int, int, struct lwp *);
int (*d_close)(dev_t, int, int, struct lwp *);
...
};
They should be like
const struct cdevsw foo_cdevsw {
fooopen, fooclose, .....
};
>How-To-Repeat:
>Fix:
>Audit-Trail:
From: Matthew Mondor <mm_lists@pulsar-zone.net>
To: gnats-bugs@NetBSD.org
Cc:
Subject: Re: misc/43348: driver(9) man page has strange examples
Date: Mon, 24 May 2010 12:57:51 -0400
On Mon, 24 May 2010 13:50:00 +0000 (UTC)
fujiyosi.ncl@gmail.com wrote:
> driver(9) man page has strange examples of foo_cdevsw and foo_bdevsw.
>
> const struct cdevsw foo_cdevsw {
> int (*d_open)(dev_t, int, int, struct lwp *);
> int (*d_close)(dev_t, int, int, struct lwp *);
> ...
> };
>
> They should be like
>
> const struct cdevsw foo_cdevsw {
> fooopen, fooclose, .....
> };
Although I agree that the above wouldn't work as a litteral code
example, I think that those were deliberate to make the required
function types obvious. That said, possibly the manual page could both
describe the C structure including those prototypes, as well as provide
an actual example, perhaps.
--
Matt
From: matthew green <mrg@eterna.com.au>
To: gnats-bugs@NetBSD.org
Cc: misc-bug-people@netbsd.org, gnats-admin@netbsd.org,
netbsd-bugs@netbsd.org, fujiyosi.ncl@gmail.com
Subject: re: misc/43348: driver(9) man page has strange examples
Date: Tue, 25 May 2010 03:15:04 +1000
> > const struct cdevsw foo_cdevsw {
> > int (*d_open)(dev_t, int, int, struct lwp *);
> > int (*d_close)(dev_t, int, int, struct lwp *);
> > ...
> > };
> >
> > They should be like
> >
> > const struct cdevsw foo_cdevsw {
> > fooopen, fooclose, .....
> > };
actually, i'd much rather the example read something like:
const struct cdevsw foo_cdevsw {
.d_open = fooopen,
.d_close = fooclose,
....
};
and promote the use of named initialisers.
.mrg.
(Contact us)
$NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007
The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.