Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!cs.utexas.edu!sdd.hp.com!decwrl!ucbvax!husc6!spdcc!esegue!compilers-sender From: worley@compass.com (Dale Worley) Newsgroups: comp.compilers Subject: Re: RS/6000 Optimizer breaks code -- suggestions? Keywords: C, optimize, debug Message-ID: <9008291355.AA17939@sn1987a.compass.com> Date: 29 Aug 90 13:55:05 GMT Sender: compilers-sender@esegue.segue.boston.ma.us Reply-To: worley@compass.com (Dale Worley) Organization: Compilers Central Lines: 16 Approved: compilers@esegue.segue.boston.ma.us In-Reply-To: johnv@metaware.com's message of 27 Aug 90 20:48:40 GMT From: johnv@metaware.com (John Vinopal) The union in this case was in fact used as a type cast of sorts; a method to prevent a short from overflowing. Bad style and not portable begins to sum up this approach. However... Yes, since the results of using a union for type punning are undefined (ANSI 3.3, 3.5.2.1), one might say that the code is bad style. One might also say that it is incorrect, and that the user can't expect *anything* from it. Dale Worley Compass, Inc. worley@compass.com -- Send compilers articles to compilers@esegue.segue.boston.ma.us {ima | spdcc | world}!esegue. Meta-mail to compilers-request@esegue.