- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This Fortran code snippet compiles with gfortran, but not with Intel because the Intel Fortran compiler wants the kind declarations to be the first in the type block. Which behavior is standard-conforming?
program pdt_kind_order
type :: pdt_type(ikind, rkind)
integer :: np
integer , kind :: ikind
integer , kind :: rkind
end type pdt_type
end
Here are the error messages:
pdt_kind_order.f90(2): error #8723: This type parameter name has not been defined. [IKIND]
type :: pdt_type(ikind, rkind)
---------------------^ pdt_kind_order.f90(2): error #8723: This type parameter name has not been defined. [RKIND]
type :: pdt_type(ikind, rkind)
----------------------------^ compilation aborted for pdt_kind_order.f90 (code 1)
1 Solution
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
gfortran has an extension - the standard (F2018 R726) says that type-param-def-stmts must appear first, then private-or-sequence, and then components. If gfortran doesn't complain about this when you ask for standards checking, it's a bug.
Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
gfortran has an extension - the standard (F2018 R726) says that type-param-def-stmts must appear first, then private-or-sequence, and then components. If gfortran doesn't complain about this when you ask for standards checking, it's a bug.
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