Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.
29281 Discussions

ifort cannot NULLIFY a pointer of the derived data type function

mckim
Beginner
963 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
963 Views
I can't reproduce this problem - which exact version of ifort are you using and what compile options?
0 Kudos
mckim
Beginner
963 Views
It is Version 8.0, and compiled with

ifort -o run bug.f90

Thank you.


0 Kudos
Steven_L_Intel1
Employee
963 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