From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f7344,1555b3aaf4501faf X-Google-Attributes: gidf7344,public X-Google-Thread: 10f8a1,1555b3aaf4501faf X-Google-Attributes: gid10f8a1,public X-Google-Thread: f7cd1,1555b3aaf4501faf X-Google-Attributes: gidf7cd1,public X-Google-Thread: 1094ba,1555b3aaf4501faf X-Google-Attributes: gid1094ba,public X-Google-Thread: 1164f8,1555b3aaf4501faf X-Google-Attributes: gid1164f8,public 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 Message-ID: <59bvom$n16$1@nntpd.lkg.dec.com>#1/1 X-Deja-AN: 204950732 distribution: world sender: lionel@quark.enet.dec.com (Steve Lionel) references: <1996Dec17.055242.11669@riksun.riken.go.jp> <5974lu$e3d$1@nntpd.lkg.dec.com> <599qk4$r0v@news.iastate.edu> organization: Digital Equipment Corporation, Nashua NH reply-to: lionel@quark.zko.dec.com (Steve Lionel) newsgroups: comp.lang.fortran,comp.os.vms,vmsnet.alpha,vmsnet.misc,comp.sys.dec 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/