Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Avoid calling vs_len(ptr) from within pure procs

Introducing vstrs to the dom resulted in gfortran (but
not g95) flagging errors:

m_dom_dom.F90:9086.18:

          n = len(arg%ownerDocument%docExtras%xds%intSubset)
                 1
Error: Procedure argument at (1) is local to a PURE procedure and has the POINTER attribute
m_dom_dom.F90:7969.14:

      n = len(arg%docExtras%xds%inputEncoding)
             1
Error: Procedure argument at (1) is local to a PURE procedure and has the POINTER attribute
m_dom_dom.F90:7919.14:

      n = len(arg%docExtras%xds%encoding)
             1
Error: Procedure argument at (1) is local to a PURE procedure and has the POINTER attribute

It looks like we can avoid this by changing type(node), pointer to
type(node), intent(in)... and I'm not sure I can see which constraint in 12.6 is being
violated here.
  • Loading branch information...
commit c630173523297f6ff54862f3b17f004520ab9cbe 1 parent 7fff229
@andreww authored
View
4 dom/m_dom_document.m4
@@ -993,7 +993,7 @@ TOHW_m_dom_set(logical, xmlStandalone, np%docExtras%xds%standalone, (DOCUMENT_NO
end subroutine setXmlVersion
pure function getXmlEncoding_len(arg, p) result(n)
- type(Node), pointer :: arg
+ type(Node), intent(in) :: arg
logical, intent(in) :: p
integer :: n
@@ -1026,7 +1026,7 @@ TOHW_m_dom_set(logical, xmlStandalone, np%docExtras%xds%standalone, (DOCUMENT_NO
end function getXmlEncoding
pure function getInputEncoding_len(arg, p) result(n)
- type(Node), pointer :: arg
+ type(Node), intent(in) :: arg
logical, intent(in) :: p
integer :: n
View
6 dom/m_dom_document_type.m4
@@ -50,7 +50,11 @@ TOHW_m_dom_contents(`
! function getSystemId(docType) result(c) See m_dom_common
pure function getInternalSubset_len(arg, p) result(n)
- type(Node), pointer :: arg
+ ! gfortran does not like the use pointer to call
+ ! len_vs below, so we can defeference on _this_
+ ! call and the error goes away. I think. Need to
+ ! check. AMW
+ type(Node), intent(in) :: arg
logical, intent(in) :: p
integer :: n
View
12 dom/m_dom_dom.F90
@@ -7909,7 +7909,7 @@ subroutine setXmlVersion(arg, s, ex)
end subroutine setXmlVersion
pure function getXmlEncoding_len(arg, p) result(n)
- type(Node), pointer :: arg
+ type(Node), intent(in) :: arg
logical, intent(in) :: p
integer :: n
@@ -7959,7 +7959,7 @@ function getXmlEncoding(arg, ex)result(s)
end function getXmlEncoding
pure function getInputEncoding_len(arg, p) result(n)
- type(Node), pointer :: arg
+ type(Node), intent(in) :: arg
logical, intent(in) :: p
integer :: n
@@ -7991,7 +7991,7 @@ function getInputEncoding(arg, ex)result(s)
endif
if (arg%nodeType==DOCUMENT_NODE) then
- s = as_chars(arg%docExtras%xds%inputEncoding)
+ s = as_chars(arg%docExtras%xds%inputEncoding)
elseif (arg%nodeType==ENTITY_NODE) then
s = "" !FIXME revisit when we have working external entities
else
@@ -9075,7 +9075,11 @@ end function getNotations
! function getSystemId(docType) result(c) See m_dom_common
pure function getInternalSubset_len(arg, p) result(n)
- type(Node), pointer :: arg
+ ! gfortran does not like the use pointer to call
+ ! len_vs below, so we can defeference on _this_
+ ! call and the error goes away. I think. Need to
+ ! check. AMW
+ type(Node), intent(in) :: arg
logical, intent(in) :: p
integer :: n
Please sign in to comment.
Something went wrong with that request. Please try again.