Skip to content

Commit bb8573f

Browse files
committed
add warning in code. Keep Travis at gfortran-6.
1 parent 23e1a1f commit bb8573f

File tree

1 file changed

+4
-25
lines changed

1 file changed

+4
-25
lines changed

src/json_value_module.F90

Lines changed: 4 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -6922,6 +6922,9 @@ end subroutine wrap_json_get_string_vec_by_path
69226922
!
69236923
!@note This is somewhat inefficient since it does
69246924
! cycle through the array twice.
6925+
!
6926+
!@warning The allocation of `vec` doesn't work with
6927+
! gfortran 4.9 or 5 due to compiler bugs
69256928

69266929
subroutine json_get_alloc_string_vec(json, me, vec, ilen)
69276930

@@ -6963,17 +6966,8 @@ subroutine get_chars_from_array(json, element, i, count)
69636966
!size the output array:
69646967
if (.not. initialized) then
69656968
! string length long enough to hold the longest one
6966-
!#if defined __GFORTRAN__
6967-
! ! this is a work-around for a bug
6968-
! ! in the gfortran 4.9 compiler.
6969-
! call allocate_vec(max_len,count)
6970-
! !block
6971-
! ! character(kind=CK,len=max_len),dimension(count) :: tmp_array
6972-
! ! vec = tmp_array
6973-
! !end block
6974-
!#else
6969+
! Note that this doesn't work with gfortran 4.9 or 5.
69756970
allocate( character(kind=CK,len=max_len) :: vec(count) )
6976-
!#endif
69776971
initialized = .true.
69786972
end if
69796973

@@ -6990,21 +6984,6 @@ subroutine get_chars_from_array(json, element, i, count)
69906984

69916985
end subroutine get_chars_from_array
69926986

6993-
!subroutine allocate_vec(max_len,count)
6994-
!
6995-
!!! try to allocate on assignment to avoid gfortran bug.
6996-
!
6997-
!implicit none
6998-
!
6999-
!integer(IK),intent(in) :: max_len
7000-
!integer(IK),intent(in) :: count
7001-
!
7002-
!character(kind=CK,len=max_len),dimension(count) :: tmp_array
7003-
!
7004-
!vec = tmp_array
7005-
!
7006-
!end subroutine allocate_vec
7007-
70086987
end subroutine json_get_alloc_string_vec
70096988
!*****************************************************************************************
70106989

0 commit comments

Comments
 (0)