- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
When compiling the attached code with ifort I get:
error #8171: This is not a valid attribute for the procedure declaration statement. [PROTECTED]
procedure(i_f), pointer, protected :: p_f => null()
--------------------------^
compilation aborted for protected-procpointers.f90 (code 1)
However, from the standard I see
C535 (R501) The PROTECTED attribute is permitted only for a
procedure pointer or named variable that is not in a common block.
so I think that the code is fine.
ifort -V
Intel Fortran Intel 64 Compiler Professional for applications running on Intel 64, Version 11.1 Build 20100414 Package ID: l_cprof_p_11.1.072
Copyright (C) 1985-2010 Intel Corporation. All rights reserved.
module m
implicit none
abstract interface
pure function i_f(x) result(y)
real, intent(in) :: x
real :: y
end function i_f
end interface
!procedure(i_f), pointer :: p_f => null() ! this works
procedure(i_f), pointer, protected :: p_f => null()
end module m
error #8171: This is not a valid attribute for the procedure declaration statement. [PROTECTED]
procedure(i_f), pointer, protected :: p_f => null()
--------------------------^
compilation aborted for protected-procpointers.f90 (code 1)
However, from the standard I see
C535 (R501) The PROTECTED attribute is permitted only for a
procedure pointer or named variable that is not in a common block.
so I think that the code is fine.
ifort -V
Intel Fortran Intel 64 Compiler Professional for applications running on Intel 64, Version 11.1 Build 20100414 Package ID: l_cprof_p_11.1.072
Copyright (C) 1985-2010 Intel Corporation. All rights reserved.
module m
implicit none
abstract interface
pure function i_f(x) result(y)
real, intent(in) :: x
real :: y
end function i_f
end interface
!procedure(i_f), pointer :: p_f => null() ! this works
procedure(i_f), pointer, protected :: p_f => null()
end module m
Link Copied
4 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I agree that your code is legal and that the compiler should accept this. I'll report it to the developers. The issue ID is DPD200156432.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
OK, thank you!
Marco
Marco
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Marco,
The standards committee realized that the standard did not have appropriate wording regarding the PROCEDURE statement to allow this usage, but it was intended that it should work. An interpretation has been filed and we'll fix the compiler.
The standards committee realized that the standard did not have appropriate wording regarding the PROCEDURE statement to allow this usage, but it was intended that it should work. An interpretation has been filed and we'll fix the compiler.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I expect this to be fixed in the next major release, scheduled for November.

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page