From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fee84,9619a7b956b3cb13,start X-Google-Attributes: gidfee84,public X-Google-Thread: 1164f8,9619a7b956b3cb13,start X-Google-Attributes: gid1164f8,public X-Google-ArrivalTime: 1994-03-17 03:37:50 PST Xref: gmd.de comp.unix.osf.osf1:2560 comp.sys.dec:14428 Newsgroups: comp.unix.osf.osf1,comp.sys.dec Path: gmd.de!xlink.net!howland.reston.ans.net!news.cac.psu.edu!news.pop.psu.edu!ctc.com!news.mic.ucla.edu!library.ucla.edu!ihnp4.ucsd.edu!swrinde!cs.utexas.edu!uunet!world!cmr From: cmr@world.std.com (Charles M Richmond) Subject: Re: DEC AXP (Alpha) c89 bug Message-ID: Organization: Integrated International Systems Corp. One Longfellow Place, Suite 3309, Boston, Ma. References: Date: Thu, 17 Mar 1994 11:37:50 GMT coates@kelvin.physics.uq.oz.au (Tony Coates) writes: >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. >-- If you would provide us with an "actual" failing case (bad pun) then the net might be able to help. I would guess that your function evaluation and your case data use different types. Personally, I like c89. Charlie -- ***************************************************************************** * Charles Richmond Integrated International Systems Corporation * * cmr@asoko.iisc.com cmr@world.std.com * * Specializing in UNIX, X, Image Processing, and Communications. *