Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.

Line length problems (possible bug)

jrfsousa
Beginner
675 Views
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
0 Kudos
4 Replies
mecej4
Honored Contributor III
675 Views
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.
0 Kudos
jrfsousa
Beginner
675 Views
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
0 Kudos
Steven_L_Intel1
Employee
675 Views
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.
0 Kudos
Steven_L_Intel1
Employee
675 Views
This has been fixed for a future release.
0 Kudos
Reply