bug-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: mtab: libdiskfs / ext2fs support changes


From: Niels Möller
Subject: Re: mtab: libdiskfs / ext2fs support changes
Date: 10 Sep 2002 15:11:12 +0200
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2

David Walter <address@hidden> writes:

> +++ ext2fs.c  10 Sep 2002 02:24:24 -0000
> ...
> +extern char*diskfs_mount_point;

It's poor style to declare global variables like this, in a random C
file that happens to use the variable...

> +  /* Prototype for internal routine diskfs_notify_mtab */
> +  void diskfs_notify_mtab(char*);

... and even worse to declare a function that way.

Declarations for global functions and variables should always be put
in some header file which is included both by the file defining the
variable/function in question, and by all files using it. That way,
you get some help from the C compiler to catch type errors.

Hmm, looking at your patch, it seems you already have a declaration of
the diskfs_notify_mtab function in diskfs.h, so you can just delete
the above declaration from extfs.c. As for diskfs_mount_point, if
libdiskfs users like ext2 are supposed to use that variable, the
declaration should move from libdiskfs/priv.h to libdiskfs/diskfs.h.

Best regards,
/Niels




reply via email to

[Prev in Thread] Current Thread [Next in Thread]