This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: help: what's the meaning "dereferencing pointer to incomplete type"
- From: Ian Lance Taylor <ian at airs dot com>
- To: "Xiaoshan Sun" <xssun at insun dot hit dot edu dot cn>
- Cc: gcc-help at gcc dot gnu dot org
- Date: 09 Apr 2005 10:34:16 -0400
- Subject: Re: help: what's the meaning "dereferencing pointer to incomplete type"
- References: <WorldClient-F200504091639.AA39270148@insun.hit.edu.cn>
"Xiaoshan Sun" <xssun@insun.hit.edu.cn> writes:
> i have a programming problem using gcc compiler.
> when i compile a C source file ,i got the error message:
> "dereferencing pointer to incomplete type"
> this is caused by a line:
> pqtemp->offset=0;
> where "pqtemp " is a pointer of a "struct type".
> so i need someone tell me what does the error message
> "dereferencing pointer to incomplete type"
> refer to ??
This is a question about C, not a question about gcc.
You have written something like
struct type *pqtemp;
without ever defining "struct type". That is valid, but it is not
valid to use pqtemp->offset without defining struct type.
Ian