Someone has caused regressions in gfortran (c_char_tests_red.f03, now PR33330)
Richard Guenther
richard.guenther@gmail.com
Fri Sep 7 13:39:00 GMT 2007
On 9/7/07, Tim Prince <tprince@computer.org> wrote:
> Dominique Dhumieres wrote:
> > In comment #7 of PR33330, Richard Guenther asked the following question
> > I cannot answer:
> >
> >> Btw, is it mandated by the fortran standard to pass a scalar as array
> >> reference?
> >
> > Does anyone knows the answer? or should it be asked on comp.lang.fortran?
> >
> Here, it looks as if you mean passing a character string of length 1 as
> a variable length string. Certainly, this should be no problem. Pardon
> me if I misunderstood.
> In either case, there should be plenty of references in c.l.f archives.
> In general, passing a scalar where an array reference is required is
> non-standard and a serious portability issue. Use of module or
> interface syntax should cause any problems to be diagnosed.
> For CHARACTER type, there is a distinction between an array (of
> character strings, possibly of length 1) and a scalar character string.
What I was after in this particular context is that the miscompilation
would have
not occured if the frontend passed the character as char* and did the
de-reference
as plain indirect reference instead of an array reference.
Richard.
More information about the Fortran
mailing list