- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi all, I note a problem with the attached code, which does not compile with ifort:
$ ifort test.f90 -o test
test.f90(3): error #6364: The upper bound shall not be omitted in the last dimension of a reference to an assumed size array. [MSG]
character(len=*), parameter :: msg(*) = (/"abc","123","?!$"/)
--------------------------------^
test.f90(5): error #6364: The upper bound shall not be omitted in the last dimension of a reference to an assumed size array. [MSG]
write(*,*) msg
------------^
compilation aborted for test.f90 (code 1)
I think this is a problem in ifort, since there are no assumed size
arrays in the code (it seems like "parameter" is ignored).
$ ifort -V
Intel(R) Fortran Intel(R) 64 Compiler XE for applications running on Intel(R) 64, Version 14.0 Build 20130728
Thank you,
Marco Restelli
program test
character(len=*), parameter :: msg(*) = (/"abc","123","?!$"/)
write(*,*) msg
end program test
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi again, I see now that the problem is not specific to character array,
integer, parameter :: msg(*) = (/1,2,3/)
gives the same error. I wonder whether I am wrong assuming that this should work... I can't find any reference for it, but I see gfortran accepts it without warnings even enabling "pedantic" debugging options.
Regards,
Marco Restelli
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This is a F2008 feature, implied-shape arrays, we don't yet support. It's on our list to be done eventually.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Steve, thank you, makes sense.
Marco Restelli
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page