Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
28851 Discussions

-Wsurprising warning for overloaded intrinsic size

FilippoMonari
Beginner
1,273 Views

Hi all, 

I am in a software package submission process, and when I undertake it I get the following warning that prevents me to complete it:

use numbers_utils
      |      1
Warning: Type specified for intrinsic function ‘size’ at (1) is ignored [-Wsurprising]

In particular, I have overloaded the intrinsic function "size" in the module "types", that I import into  "numbers_utils". The definition of the overloaded interface follows:

 

interface size
  module procedure number__size
  module procedure graph__size
end interface size

...

pure function number__size (x) result(sz)
  implicit none
  type(number), intent(in) :: x
  integer :: sz
  sz  = 0
  if (is_allocated(x)) sz = product(x%shp)
end function number__size

pure function graph__size (x) result(sz)
  implicit none
  type(graph), intent(in) :: x
  integer :: sz
  sz = 0
  if (is_allocated(x)) sz = size(x%nodes)
end function graph__size

 

I am compiling with "gfortran" version 7.5.0 on Ubuntu 18.04, and am not able to reproduce the warning on my environment and not even a couple of VM that I have running on AWS. The submission process runs on a Debian server. As quick fix I will avoid the overloading which I think it is what is causing the problem. However I would be glad if someone could point me towards the actual cause of this warning, so as to correctly write the overloaded interface in the future.

Labels (1)
0 Kudos
1 Solution
mecej4
Honored Contributor III
1,259 Views

Your question is about a gFortran compiler option. Intel Fortran does not have that option. Please ask in an appropriate forum.

View solution in original post

0 Kudos
1 Reply
mecej4
Honored Contributor III
1,260 Views

Your question is about a gFortran compiler option. Intel Fortran does not have that option. Please ask in an appropriate forum.

0 Kudos
Reply