From: cmr@world.std.com (Charles M Richmond)
Subject: Re: DEC AXP (Alpha) c89 bug
Date: Thu, 17 Mar 1994 11:37:50 GMT [thread overview]
Message-ID: <CMt4B2.CBr@world.std.com> (raw)
In-Reply-To: COATES.94Mar17111610@kelvin.physics.uq.oz.au
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(<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.
>--
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. *
next prev parent reply other threads:[~1994-03-17 11:37 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
1994-03-17 16:16 DEC AXP (Alpha) c89 bug Tony Coates
1994-03-17 11:37 ` Charles M Richmond [this message]
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