From: "Mark A. Greer" <mgreer@mvista•com>
To: Paul Mackerras <paulus@samba•org>
Cc: David Woodhouse <dwmw2@infradead•org>,
Dieu Morales <dieumorales@yahoo•com>,
linuxppc-embedded@lists•linuxppc.org,
Brian Waite <waite@skycomputers•com>
Subject: Re: GT64260_eth (Ethernet) Driver
Date: Fri, 25 Jun 2004 18:47:52 -0700 [thread overview]
Message-ID: <40DCD5C8.3080307@mvista.com> (raw)
In-Reply-To: <16604.50729.850526.239189@cargo.ozlabs.ibm.com>
Paul Mackerras wrote:
>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.
>
Yes but chances are you're going to look it up anyway (no matter what
type of creature it is). Plus with cscope or something similar its
pretty quick/easy to look it up.
>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>.
>
>
Hmm, it seems like the real problem in this example is that the include
files are not written and/or split out well. Isn't your "struct foo;"
example just a hack to work around that? Or am I not getting it?
Anyway, I'll use "struct foo;"s from now on (and get rid of the
typedef's I already have).
Mark
** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/
next prev parent reply other threads:[~2004-06-26 1:47 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-06-20 20:27 GT64260_eth (Ethernet) Driver Dieu Morales
2004-06-23 22:39 ` Mark A. Greer
2004-06-24 8:37 ` David Woodhouse
2004-06-24 11:23 ` Brian Waite
2004-06-24 18:46 ` Mark A. Greer
2004-06-24 19:02 ` Mark A. Greer
2004-06-25 7:10 ` David Woodhouse
2004-06-25 22:05 ` Mark A. Greer
2004-06-25 23:43 ` David Woodhouse
2004-06-26 0:07 ` Mark A. Greer
2004-06-26 0:41 ` Paul Mackerras
2004-06-26 1:47 ` Mark A. Greer [this message]
2004-07-29 3:19 ` Dieu Morales
2004-07-29 17:28 ` Mark A. Greer
2004-06-29 14:08 ` David Woodhouse
2004-06-29 15:23 ` BAT mapping Linh Dang
2004-06-29 17:59 ` Linh Dang
-- strict thread matches above, loose matches on Subject: below --
2005-09-19 18:53 GT64260_eth (Ethernet) Driver Earl Olsen
2005-09-20 16:02 Earl Olsen
2005-09-20 17:13 ` Brian Waite
2005-09-20 18:32 ` Mark A. Greer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=40DCD5C8.3080307@mvista.com \
--to=mgreer@mvista$(echo .)com \
--cc=dieumorales@yahoo$(echo .)com \
--cc=dwmw2@infradead$(echo .)org \
--cc=linuxppc-embedded@lists$(echo .)linuxppc.org \
--cc=paulus@samba$(echo .)org \
--cc=waite@skycomputers$(echo .)com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox