- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi all!
Compiling the code bellow with:
ifort -stand f95 -warn ./osc.f90
Generates an unterminated block error because the compiler seems not to be able to read the whole long line.
Compiling without either (or both)-stand f95 -warn gives no unexpected errors.
Furthermore if you comment the call to dummy() it will also compile only with the expected warnings.
Sorry for including the code this way but I could not manage to find how to attach files...
Best regards,
Jos Rui
!-- Code -----------------
module osc_m
implicit none
private
public :: &
really_long_name_sub, &
really_really_long_name_sub
integer, public :: really_long_name_var
integer, public :: really_really_long_name_var
contains
subroutine really_long_name_sub(size,out)
integer, intent(in) :: size
integer, intent(out) :: out
out=size+1
return
end subroutine really_long_name_sub
subroutine really_really_long_name_sub(size, out)
integer, intent(in) :: size
integer, intent(out) :: out
out=size+1
return
end subroutine really_really_long_name_sub
end module osc_m
program osc
use osc_m
implicit none
real, allocatable :: omega(:)
call dummy()
if(allocated(omega)) then; really_long_name_var = size(omega); deallocate(omega, stat=really_really_long_name_var); if(really_really_long_name_var/=0)then; call really_really_long_name_sub(really_really_long_name_var,really_really_long_name_var); call really_long_name_sub(really_long_name_var, really_long_name_var); end if; end if
stop
end program osc
Link Copied
4 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Assuming that the source line with many semicolons that you posted above is really a single line (with line folds graciously provided by the forum formatter software), that line is over 132 characters long. Accepting lines longer than 132 characters is a vendor extension from the point of view of the F95 standard.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Yes you are quite rigth.
But it should always either produce an error or a warning, not produce either an error or a warning depending of what the previous line of code is.
That code is produced from the preprocessor and yes it is very ugly.
Best regards,
Jos Rui
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
There is a bug here and that is that if -warn interface is used, it doesn't properly handle the long lines when standards checking is also enabled. I will report this to the developers./ As a workaround, you can add -warn nointerface when compiling this source. Issue ID is DPD200175196.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This has been fixed for a future release.

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