mutual reference in structures

David Goodenough dg at lakart.UUCP
Tue May 9 00:42:44 AEST 1989


>From article <6712 at medusa.cs.purdue.edu>, by bouma at cs.purdue.EDU (William J. Bouma):
> Please tell me how to get C to accept the following or equivalent code:
> 
> typedef union a {
>     b_ *pb;
> } a_;
> 
> typedef struct b {
>     a_ va;
> } b_;

Trivial.

Get rid of the typedefs.

union a {
    struct b *pb;
};

struct b {
    union a va;
};

works just fine on my compiler. (Greenhills family)

Yet another reason not to get typedef happy :-)
-- 
	dg at lakart.UUCP - David Goodenough		+---+
						IHS	| +-+-+
	....... !harvard!xait!lakart!dg			+-+-+ |
AKA:	dg%lakart.uucp at xait.xerox.com		  	  +---+



More information about the Comp.lang.c mailing list