union *func()

David Lai lai at vedge.UUCP
Sat Oct 29 03:07:24 AEST 1988


In article <2205 at arcturus> evil at arcturus.UUCP (Wade Guthrie) writes:
>Is the following code portable, strictly conforming, etc.
>	a = function()->member;
>as in something like the following (really simplified) code:
>(proceeds to describe the union pointer of the function return type...)
>It works on (shudder) a VAX running VMS, and for this reason, I
>suspect it is not portable -- can anyone help?

It works on suns and hp-ux (sys V) machines also.  However I read
somewhere (Harbison & Steele):

	-> operator requires an object that is an lvalue
	a function call is NEVER an lvalue

So there is some discrepency here.  Anyone care to comment on what ANSI
says?
-- 
	"What is a DJ if he can't scratch?"  - Uncle Jamms Army
The views expressed are those of the author, and not of Visual Edge, nor Usenet.
David Lai (vedge!lai at larry.mcrcim.mcgill.edu || ...watmath!onfcanim!vedge!lai)



More information about the Comp.std.c mailing list