functions returning structures and addressability

Mike Caplinger mike at bambi.UUCP
Wed Jul 2 00:59:54 AEST 1986


Probably an old question, but is the code

struct foo {
	int x, y;
};

struct foo f();

{
	...
	... = f().x;
}

legal C or not?  The Apollo C compiler accepts it, the Sun PCC rejects
it with a "must be addressable" message.  Does ANSI C say anything about
this?

Please respond to me, I don't read this group.

	Mike Caplinger
	mike at bellcore.arpa
	ihnp4!bambi!mike



More information about the Comp.lang.c mailing list