GT64260_eth (Ethernet) Driver

Paul Mackerras paulus at samba.org
Sat Jun 26 10:41:13 EST 2004


Mark A. Greer writes:

> Ahh, G*d I hate that...struct aaa, struct bbb, struct ccc all over the
> place when its not necessary & adds no value.  Anyway, I will do that.

It does make things clearer for the reader - when you see a
declaration "struct foo bar;" you know that it is a struct, but if you
see "foo_t bar;" you have no clue what sort of thing it is without
going and looking elsewhere.

The other advantage to using "struct" is that it can help straighten
out include file messes.  If you have a header where you need to
declare a function that takes a foo_t *, you have no choice but to
#include <foo.h>, or whatever the header is that defines foo_t.  That
can easily lead to messes where foo.h needs to include other things
which end up including everything plus the kitchen sink.  If you
instead declare your function as taking a struct foo *, then you can
solve the problem by simply putting a "struct foo;" declaration in
your header, and then you don't need to #include <foo.h>.

Paul.

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/





More information about the Linuxppc-embedded mailing list