- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The following extract:
[fortran]
MODULE PureFunctionWarning
IMPLICIT NONE
PRIVATE
INTERFACE ToValue
MODULE PROCEDURE ToValue_int
END INTERFACE ToValue
CHARACTER(*), PARAMETER :: fmt_tovalue = "('(G',I0,'.0)')"
CONTAINS
ELEMENTAL SUBROUTINE ToValue_int(str, val, ierr)
!---------------------------------------------------------------------------
CHARACTER(*), INTENT(IN) :: str
INTEGER, INTENT(OUT) :: val
INTEGER, INTENT(OUT) :: ierr
!---------------------------------------------------------------------------
CHARACTER(10) :: fmt_string
!***************************************************************************
WRITE (fmt_string, fmt_tovalue) LEN(str)
READ (str, fmt_string, IOSTAT=ierr) val
END SUBROUTINE ToValue_int
PURE FUNCTION len_fmt3(str) RESULT(l)
!---------------------------------------------------------------------------
CHARACTER(*), INTENT(IN) :: str
INTEGER :: l
!---------------------------------------------------------------------------
INTEGER :: stat
!***************************************************************************
CALL ToValue(str, l, stat) ! Call via the generic - get warning.
! CALL ToValue_int(str, l, stat) ! Cal the specific - no warning.
IF (stat /= 0) l = 0
END FUNCTION len_fmt3
END MODULE PureFunctionWarning
[/fortran]
when compiled with 13.0.0.089, gives warnings which I think are bogus, noting the generic/specific comments above.
[plain]
>ifort /c /check:all /warn:all /stand:f03 /standard-semantics PureFunctionWarning.f90
Intel(R) Visual Fortran Compiler XE for applications running on IA-32, Version 13.0.0.089 Build 20120731
Copyright (C) 1985-2012 Intel Corporation. All rights reserved.
PureFunctionWarning.f90(24): warning #7363: Standard F2003 does not allow a dummy argument to a pure function to be used
in a variable definition context. [STR]
PURE FUNCTION len_fmt3(str) RESULT(l)
-------------------------^
>ifort /c /check:all /warn:all /stand:f95 /standard-semantics PureFunctionWarning.f90
Intel(R) Visual Fortran Compiler XE for applications running on IA-32, Version 13.0.0.089 Build 20120731
Copyright (C) 1985-2012 Intel Corporation. All rights reserved.
PureFunctionWarning.f90(24): warning #7363: Standard F95 does not allow a dummy argument to a pure function to be used i
n a variable definition context. [STR]
PURE FUNCTION len_fmt3(str) RESULT(l)
-------------------------^
[/plain]
(The plain syntax highlighter is eating backslash characters. The Fortran syntax highighter appears to have run out of paint brushes.)
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This is fixed for a release later this year.

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