bounds checking

bounds checking

Hi,

I am using Intel Fortran 12.1 update 8.

When I compile the following small program with all error checking enabled (/check:all),
the array bounds bug is not detected. Does the compiler check for bounds errors when
an array is accessed though a pointer? Would the new update 10 detect this errror?

Roman

program test_pointer_bounds
implicit none
integer,allocatable,target:: a(:)

integer,pointer:: pa(:)
allocate( a(3) )

a = 0
pa => a(3:4)  !!!

pa(2) = 1
write(*,*) a

stop

end program test_pointer_bounds

5 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

This is, in my view, a compiler bug. If it has not been previously reported, I will let the developers know. Issue ID is DPD200182047.

Steve - Intel Developer Support

Array bounds checking in pointer assignment has been implemented for a future (2016) major release.

Steve - Intel Developer Support

Steve,

In 3 years, you haven't changed a bit !

Only if that were so....

Steve - Intel Developer Support

Leave a Comment

Please sign in to add a comment. Not a member? Join today