Path: utzoo!telly!attcan!uunet!huxley!steve From: steve@huxley.huxley.bitstream.com (Steve Stein) Newsgroups: comp.sys.mac.programmer Subject: Re: Known Symantec Think C 4.01 bug and work-around Message-ID: Date: 24 Oct 90 14:59:28 GMT References: <514@tci.UUCP> <7865@ucdavis.ucdavis.edu> Sender: steve@huxley.UUCP Distribution: comp Organization: Bitstream, Inc. Lines: 32 In-reply-to: lim@iris.ucdavis.edu's message of 24 Oct 90 02:52:39 GMT In article <7865@ucdavis.ucdavis.edu> lim@iris.ucdavis.edu (Lloyd Lim) writes: >In article >steve@huxley.huxley.bitstream.com (Steve Stein) writes: >>C functions may not return structs (ref: Kernighan & Ritchie's "The C >>Programming Language", Appendix A ("C Reference Manual") Section 8.4: >>"functions may not return arrays, structures, unions or functions".) > >Your K&R is out of date. This has changed with ANSI C. Here's a quote from >K&R, Second Edition, p. 129, "The only legal operations on a structure are >copying it or assigning to it as a unit, taking its address with &, and >accessing its members. Copy and assignment include passing arguments to >functions and returning values from functions as well." > >To reiterate, in Appendix C, Summary of Changes, p. 260, "Structures may be >assigned, passed to functions, and returned by functions." > ANSI C allows functions to return a struct. ANSI C allows functions to return a struct. ANSI C allows functions to return a struct. ANSI C allows functions to return a struct. ANSI C allows functions to return a struct. ANSI C allows functions to return a struct. ANSI C allows functions to return a struct. ANSI C allows functions to return a struct. ANSI C allows functions to return a struct. ... Thanks Lloyd, and to those who wrote to update my knowledge of C. (I would reply by eMail, but my eMail is bouncing.) - Steve Stein