Re: mutually referential (Pg 140 K&R2)
- From: Dave Thompson <david.thompson1@xxxxxxxxxxxxxxxx>
- Date: Mon, 02 May 2005 04:39:19 GMT
On Sat, 23 Apr 2005 15:23:02 +1000, Russell Shaw
<rjshawN_o@xxxxxxxxxxxxxxxxxxxxx> wrote:
<snip>
> struct s *p declares p using an incomplete struct s type, which is later completed
> with struct s {...}.
Correct.
> Incomplete types apply only to curly bracket things like
> enums, unions, and structs iirc.
YDNRC.
Forward declared struct and union tags are incomplete, until (the end
of) the full definition (if any). You can't forward declare an enum
tag; technically an enum type is incomplete from its type-specifier to
its closing brace, but this only means you can't use sizeof(enum foo)
as one of its own values which seems pretty silly anyway.
Array with unspecified bound is an incomplete type, which can be used
to access an actual array defined elsewhere, which definition requires
a bound and linkage requires static duration; or when used as a
Flexible Array Member at the end of a struct in C99 can be used to
access actual memory of varying sizes.
'void' is an incomplete type that cannot be completed.
- David.Thompson1 at worldnet.att.net
.
- Follow-Ups:
- Re: mutually referential (Pg 140 K&R2)
- From: pete
- Re: mutually referential (Pg 140 K&R2)
- Prev by Date: Re: a few doubts!
- Next by Date: Re: a few doubts!
- Previous by thread: Re: About casts (and pointers)
- Next by thread: Re: mutually referential (Pg 140 K&R2)
- Index(es):
Relevant Pages
|