- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
Link Copied
3 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I can't reproduce this problem - which exact version of ifort are you using and what compile options?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It is Version 8.0, and compiled with
ifort -o run bug.f90
Thank you.
ifort -o run bug.f90
Thank you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Version 8.0 is five years old. The current version is 10.1 and my test shows it works with your test case.

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page