weird warning with round-remapping list in pointer

weird warning with round-remapping list in pointer

Could it be that warning 8589 is wrong if the data target is simply contiguous?

A complete minimal program would be this ('main.f90'):

real, target  :: rank2_data(10,10)
real, pointer :: rank1_ptr(:)
rank1_ptr(1:100) => rank2_data
end

Compiling with `ifort -stand f15  main.f90`, I get main.f90(3): warning #8589: Fortran 2015 specifies that if a bound remapping list is specified, data target must be of rank one.   [RANK2_DATA]. I'm using ifort version 18.0.1.

 

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

I think you are correct. The warning is no longer flagged in the beta version of ifort 19.

 

Is it more than a misguided warning? That is, is there a special reason to suspect that rank-2 data targets do not compile correctly?

The F2008 standard says:

If bounds-remapping-list is specified, the pointer target shall be simply contiguous (6.5.4) or of rank one.

The F2018 draft standard says:

If bounds-remapping-list appears, it specifies the upper and lower bounds of each dimension of the pointer, and thus the extents; the pointer target shall be simply contiguous (9.5.4) or of rank one, ...

Note that both standards say that the target shall be either "simply contiguous" or of rank one. If the compiler is ignoring the "simply contiguous" case, that's incorrect (and the message's wording is incorrect regardless.)

In your example, the target is indeed "simply contiguous".

Steve (aka "Doctor Fortran") - Retired from Intel

Leave a Comment

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