Skip to content

Commit

Permalink
h5attr read: remove unused param H5S_ALL_F
Browse files Browse the repository at this point in the history
this unused parameter caused problems for GCC-7 recognizing TKR.

Making the arguments optional caused problems with all compilers
recognizing TKR
  • Loading branch information
scivision committed Aug 21, 2024
1 parent 44cc39d commit f2eab6b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
7 changes: 1 addition & 6 deletions src/attr_read.f90
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
submodule (h5fortran:attr_smod) attr_read

use, intrinsic :: iso_c_binding, only : C_CHAR, C_NULL_CHAR, C_F_POINTER

use hdf5, only : H5Aread_f, H5Aget_type_f, &
H5Tget_class_f, H5Tget_native_type_f, H5Tget_size_f, H5Tget_strpad_f, &
H5T_DIR_ASCEND_F, &
H5S_ALL_F
use hdf5, only : H5Aread_f

implicit none

Expand Down
4 changes: 3 additions & 1 deletion src/attr_read.inc
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@ if(attr_class == H5T_FLOAT_F .OR. attr_class == H5T_INTEGER_F) then
elseif(attr_class == H5T_STRING_F) then
select type(A)
type is (character(*)) !< kind=c_char too
call read_char(self, obj_name//":"//attr_name, A, attr_id, H5S_ALL_F, space_id)
call read_char(self, obj_name//":"//attr_name, A, attr_id, 0_HID_T, space_id)
!! the "0_HID_T" is unused by H5Aread_F. GCC 7 doesn't like H5S_ALL_F, and it's unused anyway
!! making this argument optional in read_char() caused problems with all compilers recognizing the TKR
class default
error stop 'ERROR:h5fortran:readattr: string dataset ' // obj_name // ':' // attr_name // ' needs character memory variable'
end select
Expand Down

0 comments on commit f2eab6b

Please sign in to comment.