DragonFly BSD
DragonFly submit List (threaded) for 2004-02
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

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


From: Matthew Dillon <dillon@xxxxxxxxxxxxxxxxxxxx>
Date: Thu, 5 Feb 2004 09:50:56 -0800 (PST)

:> 
:> - 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



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