Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!ncar!gatech!prism!gt4512c From: gt4512c@prism.gatech.EDU (BRADBERRY,JOHN L) Newsgroups: comp.lang.fortran Subject: Re: MS-FORTRAN bug in string concatenation Message-ID: <22078@hydra.gatech.EDU> Date: 15 Feb 91 13:07:24 GMT References: <2PWGG2@MPLVAX.SRI.COM> Organization: Georgia Institute of Technology Lines: 27 In article <2PWGG2@MPLVAX.SRI.COM> HUESTIS@MPLVAX.SRI.COM (David L. Huestis) writes: >Under Microsoft FORTRAN the following simple program > > character string*4/'abc'/ > string = '*'//string > write(*,*)string > end > >produces the output '**bb' while LAHEY and VAX yield '*abc' > >Microsoft FORTRAN takes no precautions against the source strings >overlapping the destination string. Hmmmm...this looks like a problem related to another thread concerning goto's used to branch directly into the middle of IF-THEN-ELSE blocks. The 'problem' is confusion over what a compiler SHOULD do with non-standard or illegal code fragments!!! Rather than slam Microsoft FORTRAN for not being 'clairvoyant' in this case, consider this as a need to understand the proper use of the concatenation operator. The only restriction FORTRAN places on such usage is that overlapping substrings CANNOT appear on both sides of the same assignment statement... -- John L. Bradberry |Georgia Tech Research Inst|001100110011001100110011 Scientific Concepts Inc. |Microwaves and Antenna Lab|Int : gt4512c@prism 2359 Windy Hill Rd. 201-J|404 528-5325 (GTRI) |GTRI:jbrad@msd.gatech. Marietta, Ga. 30067 |404 438-4181 (SCI) |'...is this thing on..?'