Xref: utzoo comp.lang.c:13637 comp.std.c:463 Path: utzoo!yunexus!geac!syntron!jtsv16!uunet!seismo!sundc!pitstop!sun!amdcad!ames!haven!mimsy!chris From: chris@mimsy.UUCP (Chris Torek) Newsgroups: comp.lang.c,comp.std.c Subject: Re: union *func() Keywords: union, pointers, functions Message-ID: <14172@mimsy.UUCP> Date: 26 Oct 88 18:27:14 GMT Article-I.D.: mimsy.14172 References: <2205@arcturus> Organization: U of Maryland, Dept. of Computer Science, Coll. Pk., MD 20742 Lines: 24 In article <2205@arcturus> evil@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: [deleted] It is conforming, etc., if function() returns a pointer to a structure or union and the `member' field corresponds to a member of that structure or union. Likewise, a = function().member; is conforming, etc., if function() returns a structure or union and the `member' field corresponds, etc., with one additional restriction: the member must not be an array. Nonetheless, the second form is another one of those things that compilers have got wrong in the past; you are better off with lump = function(); a = lump.member; -- In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 7163) Domain: chris@mimsy.umd.edu Path: uunet!mimsy!chris