From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 1164f8,9619a7b956b3cb13 X-Google-Attributes: gid1164f8,public X-Google-Thread: fee84,9619a7b956b3cb13 X-Google-Attributes: gidfee84,public X-Google-ArrivalTime: 1994-03-17 11:16:10 PST Xref: gmd.de comp.unix.osf.osf1:2602 comp.sys.dec:14505 Path: gmd.de!newsserver.jvnc.net!nntpserver.pppl.gov!princeton!att-in!csn!magnus.acs.ohio-state.edu!math.ohio-state.edu!howland.reston.ans.net!agate!msuinfo!harbinger.cc.monash.edu.au!bunyip.cc.uq.oz.au!dingo.cc.uq.oz.au!coates From: coates@kelvin.physics.uq.oz.au (Tony Coates) Newsgroups: comp.unix.osf.osf1,comp.sys.dec Subject: DEC AXP (Alpha) c89 bug Date: 17 Mar 94 11:16:10 Organization: Department of Physics, The University of Queensland Distribution: world Message-ID: Reply-To: coates@physics.uq.oz.au NNTP-Posting-Host: kelvin.physics.uq.oz.au We just received the DEC AXP (Alpha) c89 compiler as part of DEC's cxx C++ compiler package. We are running OSF/1.3. I tried recompiling an old program which compiled under cc and ran correctly. However, after compilation with c89, the program failed. Debugging with dbx, and with the aid of a few printf statements which I had to add, I found that, when compiled with c89, a switch statement of the form switch() { case -1: ; break; case 1: ; break; default: } was reaching the default statement, even though the function evaluation yielded -1. The same statement selected the -1 case when compiled with cc. As such, I would recommend cc over c89 if possible, in spite of the fact that the pre-processor for cc is not proper ANSI (can't leave spaces in from of #line directives, for example). Cheers, Tony. -- _____________________________________________________________________________ A.B.Coates, Dept. of Physics, The University of Queensland QLD 4072 Australia. Email: coates@physics.uq.oz.au Phone: (07/+617) 365-3424 Fax: (07/+617) 365-1242 Disclaimer: The University is ignorant of my opinions, let alone guilty ... _____________________________________________________________________________