This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran 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)
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=TW4QdGpkb45Xh1SYU3l1pvAD178obP5YP0bJ8BIngGg=; b=sB7WiUlQn/CmWf9u4rCtsqDI42C7zjSq46RTw5pmeIocCGO59XodcErUVq6NBOqjXI3hjWT0DWs7C6XZzcc/8EiYPrJh17nmeAZ7Uh/ENXidwP1dDqizlNd8GsMOOZ8pOs94fuhtVufrgRzAxisdy+3EEhut/9gBFqAs2HAd2Rs=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=iz0uH5Aj0+OAd8PaIYt8OF2thes5zGfCUfhaeQ7n47g+3Djst9A73lMHOrWyGw7wsLzepOVD3QPmKmQNzxnXUTU8r6x0MHqJOBDcNGKGueO9uErwc9WkSIiyQ8txR7R8bUKc4rcuba+U5XmQ+p7pQfhTxx/xJaxZySXCRNbkYpc=
- 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.