From mboxrd@z Thu Jan 1 00:00:00 1970 From: michi1@michaelblizek.twilightparadox.com (michi1 at michaelblizek.twilightparadox.com) Date: Thu, 31 May 2012 18:40:20 +0200 Subject: [RFC]confusions about 'struct' define In-Reply-To: References: Message-ID: <20120531164019.GA2256@grml> To: kernelnewbies@lists.kernelnewbies.org List-Id: kernelnewbies.lists.kernelnewbies.org 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