From: lionel@quark.zko.dec.com (Steve Lionel)
Subject: Re: Recent Digital Fortan incompatibility for Sign Extension of Untyped Bit Constants
Date: 1996/12/19 [thread overview]
Message-ID: <59bvom$n16$1@nntpd.lkg.dec.com> (raw)
In-Reply-To: 599qk4$r0v@news.iastate.edu
In article <599qk4$r0v@news.iastate.edu>, john@iastate.edu (John Hascall) writes:
||>
|> It seems to me that the careful programmer would write:
|>
|> i4b= '00000120000'O / 2
|>
|> if that is what they wanted rather than hoping that:
|>
|> i4b= '120000'O / 2
|>
|> would be sign-extended the way they hoped. However, it
|> isn't clear to me from the explanation above whether or
|> not that would give the expected answer or not. Will
|> the fact that "2" has a type of INTEGER*2 force
|> '00000120000'O to be INTEGER*2 too? And if so, what about
|> '10000120000'O?
The leading zeroes will be ignored. The larger constant will get an error.
Not very pretty...
We've been discussing this issue among the Fortran engineering team, and we've
concluded that the current VAX behavior isn't what we want. It will take
me a while to determine just how it all ought to work without breaking
programs that rely on the "small integer constant" behavior. Bit constants,
in particular, should assume the largest integer type. The goal will be to
match the Alpha compiler's behavior in this regard.
--
Steve Lionel mailto:lionel@quark.zko.dec.com
Fortran Development http://www.digital.com/info/slionel.html
Digital Equipment Corporation
110 Spit Brook Road, ZKO2-3/N30
Nashua, NH 03062-2698 "Free advice is worth every cent"
For information on Digital Fortran, see http://www.digital.com/info/hpc/fortran/
prev parent reply other threads:[~1996-12-19 5:00 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
1996-12-17 5:00 Recent Digital Fortan incompatibility for Sign Extension of Untyped Bit Constants Takashi Ichihara
1996-12-17 5:00 ` Steve Lionel
1996-12-18 5:00 ` Petrie L M
1996-12-18 5:00 ` Ron Shepard
1996-12-19 5:00 ` Steve Lionel
1996-12-18 5:00 ` John Hascall
1996-12-19 5:00 ` Steve Lionel [this message]
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