From: michi1@michaelblizek.twilightparadox.com (michi1 at michaelblizek.twilightparadox.com)
To: kernelnewbies@lists.kernelnewbies.org
Subject: [RFC]confusions about 'struct' define
Date: Thu, 31 May 2012 18:40:20 +0200 [thread overview]
Message-ID: <20120531164019.GA2256@grml> (raw)
In-Reply-To: <CAD+1EGNbNqZSnO54NDRO083NEmGUXoetmwLE67cGh0Y55mkRVg@mail.gmail.com>
Hi!
On 00:50 Thu 31 May , harryxiyou wrote:
...
> I have never seen struct define like
>
> "struct device;
> struct device_private;
> struct device_driver;
> [...]
> struct device_node;
> struct iommu_ops;"
This basically says that these structs exist and are defined somewhere. You
need this basically for things like this:
struct b;
struct a{
struct b *b_ptr;
};
struct b{
struct a *a_ptr;
};
The struct can only be dereferenced after it is defined. Also, the storage
size is unknown, so the same applies to inlining and sizeof().
-Michi
--
programing a layer 3+4 network protocol for mesh networks
see http://michaelblizek.twilightparadox.com
next prev parent reply other threads:[~2012-05-31 16:40 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-05-30 16:50 [RFC]confusions about 'struct' define harryxiyou
2012-05-30 17:20 ` Gaurav Jain
2012-05-30 17:37 ` harryxiyou
2012-06-01 9:30 ` Bernd Petrovitsch
2012-06-04 14:18 ` Sarbojit Ganguly
2012-05-31 16:40 ` michi1 at michaelblizek.twilightparadox.com [this message]
-- strict thread matches above, loose matches on Subject: below --
2012-05-30 18:41 Rajat Sharma
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=20120531164019.GA2256@grml \
--to=michi1@michaelblizek.twilightparadox.com \
--cc=kernelnewbies@lists.kernelnewbies.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
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;
as well as URLs for NNTP newsgroup(s).