RFC legacy support for array constructor with different string lengths
Steve Kargl
sgk@troutmask.apl.washington.edu
Tue Sep 2 14:46:00 GMT 2008
On Tue, Sep 02, 2008 at 10:55:09AM +0200, Tobias Burnus wrote:
> Hi,
>
> when reading
> http://groups.google.com/group/comp.lang.fortran/browse_thread/thread/75fa01278753793e
> , I saw that
>
> character(len=14), dimension(5), parameter :: var_names &
> & = ['YEAR', 'COMPCODE', 'RECEPTYPE', 'NCOLS', 'NROWS']
>
> is now rejected with gfortran 4.4:
>
> Error: Different CHARACTER lengths (4/8) in array constructor at (1)
>
> With gfortran 4.2 and 4.3 it is accepted by default (with no warning with
> -Wall/-pedantic) but rejected with -std=f2003.
>
The behavior of 4.4 is the correct behavior. If previous
versions of gfortran accepted the constructor, then it
should be considered a bug in those previous version.
Either backport the correct behavior or accept this as
a WONTFIX bug in 4.3.
--
Steve
More information about the Fortran
mailing list