Skip to content

Allocatable array #22

Open
Open
@bingao

Description

@bingao

Hi,

I just built Fort together with the latest LLVM and Clang. I tried to compile the following simple Fortran code a.f95:

program test
    implicit none
    real(kind=8), allocatable :: ptr
    integer i
    allocate(ptr(10))
    do i = 1, 10
        ptr(i) = i
        write(6,*) ptr(i)
    end do
    deallocate(ptr)
end program test

But I got the following errors:

a.f95:5:5: error: use of undeclared identifier 'allocate'
    allocate(ptr(10))
    ^
a.f95:7:16: error: expression is not assignable
        ptr(i) = i
               ^
a.f95:10:5: error: use of undeclared identifier 'deallocate'
    deallocate(ptr)
    ^

I wonder if Fort supports allocatable array and pointer now or not? If yes, how can I solve the errors? Thank you in advance.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions