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

Missing diagnostic for invalid entry characterisics

Harald1
New Contributor II
654 Views

The following invalid code shows that a certain invalid code is not diagnized:

function f1()
  character(1)              :: f1
  character(:), allocatable :: g1
  f1 = 'f'
  return
entry g1()
  g1 = 'g'
end

function f2()
  character(1)              :: f2
  character(1), allocatable :: g2
  f2 = 'f'
  return
entry g2()
  g2 = 'g'
end

function f3()
  character(1)              :: f3
  character(1), pointer     :: g3
  f3 = 'f'
  return
entry g3()
  g3 = 'g'
end

 

% ifort ifort-entry-mismatch.f90
ifort-entry-mismatch.f90(6): error #6625: The character lengths of the functions must not be different.   [G1]
entry g1()
------^
ifort-entry-mismatch.f90(24): error #7127: The characteristics of the function named on the ENTRY statement are different from the characteristics of the result of the function named on the FUNCTION statement.   [G3]
entry g3()
------^
compilation aborted for ifort-entry-mismatch.f90 (code 1)

Case 2 with function f2/entry g2 should be rejected, too, according to F2018, 15.6.2.6
ENTRY statement, paragraph 3.  The characteristics do not match, as in the last case of the example.

 

Thanks,

Harald

0 Kudos
2 Replies
Barbara_P_Intel
Moderator
605 Views

I filed a bug report on your behalf, CMPLRIL0-34166.  I'll let you know when it is fixed.

 

0 Kudos
Devorah_H_Intel
Moderator
393 Views

The fix will be available in the next oneAPI release. 

0 Kudos
Reply