cvs commit: src/sys/fs/nullfs null_vfsops.c src/sys/fs/nwfs nwfs_vfsops.c src/sys/fs/smbfs smbfs_vfsops.c src/sys/kern vfs_default.c vfs_vnops.c src/sys/sys mount.h vnode.h src/sys/ufs/ufs quota.h ufs_quota.c ufs_vfsops.c

David O'Brien obrien at FreeBSD.org
Tue Feb 26 18:44:33 UTC 2008


On Tue, Feb 26, 2008 at 06:25:51PM +0000, Robert Watson wrote:
> To be specific, it's about code on the order of the following -- in the 
> include file:
>   vfs_quotactl_t nnpfs_quotactl;
> 
> In the .c file here nnpfs_quotactl is implemented:
>   int
>   nnpfs_quotactl(struct mount *mp, int cmd, uid_t uid, caddr_t arg,
>       d_thread_t *p)
>   {
..
> In another .c file where nnpfs_quotactl is used:
>   	.vfs_quotactl = nnpfs_quotactl,

This is one of the major warts I find with the C language.
You cannot use the typedef'ed type used in the declaration in the
definition - thus you always get these type mis-matches that a strongly
typed language would barf on.

> The compile keels over when it discovers that nnpfs_quotactl doesn't match 
> the implementation because it doesn't match the typedef.  So it's actually 
> our typedef, not Arla's typedef.

With C its just usually the types are based on the same thing.

-- 
-- David  (obrien at FreeBSD.org)


More information about the cvs-all mailing list