Usenet comp.sys.dec (1990-2013)
 help / color / mirror / Atom feed
* DEC AXP (Alpha) c89 bug
@ 1994-03-17 16:16 Tony Coates
  1994-03-17 11:37 ` Charles M Richmond
  1994-03-17 22:45 ` Holger Rasch
  0 siblings, 2 replies; 5+ messages in thread
From: Tony Coates @ 1994-03-17 16:16 UTC (permalink / raw)


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(<function evaluation>) {
	case -1: <blah>; break;
	case  1: <blah>; break;
	default: <blah>
        }

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 ...
_____________________________________________________________________________


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~1994-03-22 16:27 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1994-03-17 16:16 DEC AXP (Alpha) c89 bug Tony Coates
1994-03-17 11:37 ` Charles M Richmond
1994-03-18 16:14   ` Tony Coates
1994-03-17 22:45 ` Holger Rasch
1994-03-22 16:27   ` Andre Beck

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox