patch to style(9) man page to reflect current practices

Matthew Dillon dillon at apollo.backplane.com
Thu Feb 5 09:51:37 PST 2004


:> 
:> - we're actively moving away from K&R, so actively discourage old-style
:> declarations.
:> 
:> - Matt doesn't seem to have anything against structname_t, so don't
:> actively discourage it.
:
:Well, I don't like it. It is the same thing as typedef struct bla;
:There are places in the kernel where you want exactly that, e.g. the
:various bus tags and the like to force the inclusion of the corresponding
:header files, but otherwise it should still be discouraged.

    If structname_t represents a pointer, you can typedef it without
    having to include the header containing the actual structure.

    e.g.
    header1.h:

    struct fubar;
    typedef struct fubar *fubar_t;

    header2.h:

    struct fubar {
	....
    };

    header1 does not require header2.

						-Matt





More information about the Submit mailing list