Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!mcvax!nikhefh!i91 From: i91@nikhefh.UUCP (Fons Rademakers) Newsgroups: comp.lang.fortran Subject: Problem with substrings Message-ID: <286@nikhefh.UUCP> Date: Wed, 3-Jun-87 09:54:27 EDT Article-I.D.: nikhefh.286 Posted: Wed Jun 3 09:54:27 1987 Date-Received: Sat, 6-Jun-87 20:48:53 EDT Reply-To: i91@nikhefh.UUCP (Fons Rademakers) Distribution: world Organization: Nikhef-H, Amsterdam (the Netherlands). Lines: 21 Does somebody know what according to the FORTRAN 77 standard should happen in the following substring expression: CHARACTER*10 CH, STR STR = 'ABCDEFGHIJ' I = 6 NC = 0 CH = 'FOO'//STR(I:I+NC-1)//'BAR' My results are 1) VAX/VMS FORTRAN: CH = 'FOOBAR' 2) Gould UTX32 f77: CH = 'FOOBAR' 3) Apollo FTN : CH = 'FOOFGHIJ..' CRASH!!! (the var CH gets scrambled which results, a few statements later, in a segmentation fault) Is Apollo's FTN compiler allowed to crash (and are the other compilers too permissive) or is it an FTN compiler bug? -- Fons Rademakers