This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [gfortran] Fix PR14067


On Sun, May 30, 2004 at 05:24:13PM +0200, Tobias Schl?ter wrote:
> Paul Brook wrote:
> >>2004-05-30  Tobias Schlueter  <tobias.schlueter@physik.uni-muenchen.de>
> >>
> >>	* trans-const.c (gfc_conv_string_init): Allow variable string
> >>	length lower than initialization string length.
> >
> >
> >Ok. Please also change the comment to read "padded or truncated to the 
> >correct length".
> >
> 
> Bud privately pointed out to me that this is invalid code. If we want to 
> accept this code as an extension, I can still commit this patch, but I 
> will try to find the right place in the frontend to emit a warning or an 
> error, respectively. Right now the resolution of DATA statements is 
> somewhat mysterious to me.
> 

What's invalid about the code; other the the erronous use of
a RETURN statement.  The below code compiles with NAG's compiler
and ftnchek 

      PROGRAM GNEXDATA
      CHARACTER*31 GNCRMESS
C                             1         2         3         4
C                    1234567890123456789012345678901234567890
      DATA GNCRMESS/'   *** COASTAL RADAR    NOT LOADED *** '/
      PRINT*,GNCRMESS
      END

kargl[243] f95 -o z z.f
Obsolescent: z.f, line 1: Fixed source form
Warning: z.f, line 5: Character data-value truncated (longer than data-object)
kargl[244] ftnchek z.f

FTNCHEK Version 3.2 November 2002

File z.f:
 0 syntax errors detected in file z.f


-- 
Steve


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]