This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran 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: f77 code in gfortran


On Wednesday 28 January 2004 4:41 am, Steve Kargl wrote:
> On Tue, Jan 27, 2004 at 10:00:33PM -0600, Bud Davis wrote:
> > Is this a gfortran bug or f77 code that will have
> > to be revised to work with g77 ?
> >
> > [bdavis@localhost bin]$ /usr/local/bin/gfortran example1.f
> >  In file example1.f:2
> >
> >        GCOPEN = .TRUE.
> >                1
> > Error: Can't convert LOGICAL(4) to LOGICAL(1) at (1)
> > [bdavis@localhost bin]$ cat example1.f
> >        LOGICAL*1 GCOPEN
> >        GCOPEN = .TRUE.
> >        END
> > [bdavis@localhost bin]$
>
> AFAIK, LOGICAL does not take a byte count under any standard.

Correct. Only CHARACTER types have defined meaning for the *N notation, and 
even these are obsoleted in f9x.

The bug here is that we don't provide an implicit type conversion. I'm not 
sude what the standard says on this matter, but it seems a reasonable thing 
to do. Please file a bug report.

> Under gfortran I believe only one kind type is defined for

In gfortran all integer type kinds are valid as logical type kinds. ie. We 
have 1, 2, 4, and 8 (and possibly 16 in the future).

> LOGICAL, so LOGICAL == LOGICAL*4.  Note, LOGICAL*4 is nonstandard.

Note gfortran and g77 interpret this notation in different ways. g77 uses 
TYPE*1 as the default type, and TYPE*2 as the associated double precision 
type, etc. gfortran interprets TYPE*N as TYPE(kind=N).

I have used commercial compilers which exhibit both these behaviors. Ideally 
we would

I suspect there are some bugs in our handling of real*n type specifiers, 
however I don't think that is the problem here.

Paul


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