Path: utzoo!attcan!uunet!zephyr.ens.tek.com!tektronix!reed!minar From: minar@reed.bitnet (Nelson Minar,(???)) Newsgroups: comp.lang.c Subject: Structures Message-ID: <14302@reed.UUCP> Date: 28 Feb 90 20:13:15 GMT Sender: news@reed.UUCP Reply-To: minar@reed.bitnet (Nelson Minar) Organization: Reed College, Portland, OR Lines: 19 My copy of K&R 1 (I'll be getting 2 soon..) says "There are only two things that can be done with a structure or a union: name one of its members (by means of the . operator); or take its address (by unary &). Other operations, such as assigning from or to it or passing it as a parameter, draw an error message. In the future, it is expected that these operations, but not necessarily others, will be allowed." 1] What does ansi say about this? 2] It seems that passing a structure-by-value is illegal under this rule. Why this limitation in the original C? 3] My C compiler (Turbo C 2.0) doesn't mind passing a structure-by-value, and it allows you to set two structures equal to each other, automatically copying the elements. Is this standard behavior for most C compilers? Why does Turbo C have an warning "Warning: structure passed by value" if it is legal TC 2.0 code? Because it is potentially non-portable?