This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Someone has caused regressions in gfortran (c_char_tests_red.f03, now PR33330)
- From: "Richard Guenther" <richard dot guenther at gmail dot com>
- To: "Tim Prince" <tprince at computer dot org>
- Cc: "Dominique Dhumieres" <dominiq at lps dot ens dot fr>, gcc at gcc dot gnu dot org, hubicka at ucw dot cz, fortran at gcc dot gnu dot org
- Date: Fri, 7 Sep 2007 15:38:51 +0200
- Subject: Re: Someone has caused regressions in gfortran (c_char_tests_red.f03, now PR33330)
- References: <20070907123942.D2CC55BB46@mailhost.lps.ens.fr> <46E14FA7.5020606@computer.org>
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.