C Board  

Go Back   C Board > Platform Specific Boards > Linux Programming

Reply
 
LinkBack Thread Tools Display Modes
Old 09-15-2009, 04:02 PM   #1
Registered User
 
Join Date: Sep 2009
Posts: 5
derefrencing pointer to incomplete type error

I 'm writing a code to traverse all allocated slabs. First I traverse cache list through "cache_chain". my code is:
Code:
struct list_head cache_chain, *p;
list_for_each(p, &cache_chain){
    kmem_cache_t *cachep=list_entry(p, struct kmem_cache_t, next); 
    ...
}
but when compiling I receive following errors:
error: dereferencing pointer to incomplete type
error: invalid use of incomplete typedef 'keme_cache_t'
what should I do?
aliasghar is offline   Reply With Quote
Old 09-15-2009, 04:12 PM   #2
Registered User
 
Join Date: Sep 2004
Location: California
Posts: 2,845
Quote:
error: invalid use of incomplete typedef 'keme_cache_t'
Is that bolded part just a typo? The error lists keme_cache_t, but your code has kmem_cache_t.

If it is just a typo, then it's appears to be a problem where you typedef'd a type, but didn't include the header file for that type.
__________________
bit∙hub [bit-huhb] n. A source and destination for information.
bithub is offline   Reply With Quote
Old 09-17-2009, 04:06 AM   #3
Registered User
 
Join Date: Sep 2009
Posts: 5
yes, that's a typo.
I think the error is because of one of these two reasons:
1. the header file for kmem_cache_t is not included: I tried to find the header file but I couldn't.
2. cache_chain is not initialized. this reason is more logical for me, but I don't know how to initialize it. can you help me, please?
and, thanks for first reply.
aliasghar is offline   Reply With Quote
Old 09-17-2009, 09:31 AM   #4
subminimalist
 
MK27's Avatar
 
Join Date: Jul 2008
Location: NYC
Posts: 3,944
Quote:
Originally Posted by aliasghar View Post
1. the header file for kmem_cache_t is not included: I tried to find the header file but I couldn't.
Because it doesn't exist. I grepped thru the kernel headers and /usr/include. It is not referred to anywhere:

Then I googled this

[PATCH] Remove the deprecated "kmem_cache_t" typedef from slab.h.

apparently kmem_cache_t used to be in slab.h (a kernel header) but is no longer used in the kernel tree so has been depreciated right out.

I think the original typdef is in that post tho, so you could just paste it in.
__________________

Accuracy and integrity mean nothing if you don't make it past the censors...PYTHAGORAS
MK27 is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Beginner Needs help in Dev-C++ Korrupt Lawz C++ Programming 18 05-02-2009 12:27 PM
Testing some code, lots of errors... Sparrowhawk C Programming 48 12-15-2008 04:09 AM
Dikumud maxorator C++ Programming 1 10-01-2005 06:39 AM
Problem with Visual C++ Object-Oriented Programming Book. GameGenie C++ Programming 9 08-29-2005 11:21 PM
C++ compilation issues Rupan C++ Programming 1 08-22-2005 05:45 AM


All times are GMT -6. The time now is 01:37 AM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.0 RC2

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22