From: coates@kelvin.physics.uq.oz.au (Tony Coates)
Subject: DEC AXP (Alpha) c89 bug
Date: 17 Mar 94 11:16:10 [thread overview]
Message-ID: <COATES.94Mar17111610@kelvin.physics.uq.oz.au> (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 ...
_____________________________________________________________________________
next reply other threads:[~1994-03-17 16:16 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
1994-03-17 16:16 Tony Coates [this message]
1994-03-17 11:37 ` DEC AXP (Alpha) c89 bug Charles M Richmond
1994-03-18 16:14 ` Tony Coates
1994-03-17 22:45 ` Holger Rasch
1994-03-22 16:27 ` Andre Beck
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox