- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi everyone,
I came across this minor bug (I guess), when optional dummy arguments are used in the specification of other dummy arguments:
subroutine s1(arg1,arg2)
implicit none
integer, intent(in), optional :: arg1(:)
integer, intent(in), optional :: arg2(size(arg1))
end subroutine
subroutine s2(arg1,arg2)
implicit none
integer, intent(in), optional :: arg1(:)
integer, intent(in), optional :: arg2(merge(size(arg1),0,present(arg1)))
end subroutine
While `s2` compiles with errors (as it should), `s1` does not result in errors in `ifort (IFORT) 2021.5.0 20211109`
gfortran (7.5.0) spits out errors for both routines.
Greetings
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I hope that one of the Intel folk pick this up and submit it as a bug.
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I think that is probably not a compiler bug as such but you would get a run time error if the optional args were not present. The code is not standard conforming but the compiler is not obliged to give errors for all non-conformances. It is nice to get errors for bad code though. Did you have standards checking switched on BTW?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
That's ok for me
Regarding your BTW: If you mean the `-stand` option, there's no difference compiling with or without it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I hope that one of the Intel folk pick this up and submit it as a bug.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This report has been escalated to compiler engineering - CMPLRLLVM-36112
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page