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

ifort cannot NULLIFY a pointer of the derived data type function

mckim
Beginner
516 Views

Compiling with ifort and executing the following code demonstrates ifort has a bug when a function returns a pointer for a derived data type.


PROGRAM BUG

TYPE T
INTEGER :: i
END TYPE T

TYPE( T ), POINTER :: get

get => Check()

CONTAINS

FUNCTION Check() RESULT ( n )

TYPE( T ), POINTER :: n

NULLIFY( n )

IF( ASSOCIATED( n ) ) print *, "ifort cannot NULLIFY a pointer of the derived data type function"

END FUNCTION

END PROGRAM

0 Kudos
3 Replies
Steven_L_Intel1
Employee
516 Views
I can't reproduce this problem - which exact version of ifort are you using and what compile options?
0 Kudos
mckim
Beginner
516 Views
It is Version 8.0, and compiled with

ifort -o run bug.f90

Thank you.


0 Kudos
Steven_L_Intel1
Employee
516 Views
Version 8.0 is five years old. The current version is 10.1 and my test shows it works with your test case.
0 Kudos
Reply