- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The following code is rejected by ifort 2021.6.0:
program p
! integer, parameter :: ii(1) = findloc ([integer::1],1) ! works
integer, parameter :: ii(1) = findloc ([integer:: ],1) ! fails
print *, ii
print *, findloc ([integer::],1) ! accepted
end
This gives:
% ifort ifort-findloc.f90
ifort-findloc.f90(3): error #6821: A scalar constant is required in this context.
integer, parameter :: ii(1) = findloc ([integer:: ],1) ! fails
--------------------------------^
compilation aborted for ifort-findloc.f90 (code 1)
It shouldn't be too hard to do the simplification...
1 Solution
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I filed a bug report on this erroneous error message, CMPLRIL0-34931.
Link Copied
4 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I'd argue that this is a compiler bug as
findloc ([integer:: ],1)
looks like a legitimate constant expression (according to MFE 8.4).
I note also that gfortran --warn-all (MSYS2 10.2.0) compiles this without any warnings and produces the desired output.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I filed a bug report on this erroneous error message, CMPLRIL0-34931.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This FINDLOC() issue is resolved in the latest Fortran compilers that were released in December. Give it a try!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Yes, it is fixed in the latest version. Thanks!
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