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

Assignment to unallocated derived type / array

lklawrie1
Beginner
1,030 Views
This one surprised me. (From another developer using a different compiler). I verified it using CVF -- have not tried IVF yet.
Derived type is not allocated due to various reasons but the assignment:
x%y=0
flies by okay in CVF. No error.
Any idea what compiler flags I might use to make sure this trips up?
Linda
0 Kudos
7 Replies
Steven_L_Intel1
Employee
1,030 Views
There isn't anything in CVF, or really IVF, to catch this at this time. It's on our list. You might get an array bounds error in IVF if you had that enabled and tried it, or maybe an access violation.

This is a general class of pointer and shape checking that is missing from the product.
0 Kudos
lklawrie1
Beginner
1,030 Views

FYI -- I guess g95 has it as this is where it failed. OTOH, they don't have debugging or apparently very good traceback so he (the person using the source code) had to resort to putting in print statements for tracing the problem. :-)

Thanks. I just tried IVF -- inmy release version (which doesn't have extensive array bounds tracking turned on) it doesn't trip.

Linda

0 Kudos
Steven_L_Intel1
Employee
1,030 Views
Yeah, this is a sore point with me - we really need to do a better job with run-time diagnostics. The more people who file feature requests for such things, the more likely they'll get done.
0 Kudos
lklawrie1
Beginner
1,030 Views

Do I need to do something more (to file a feature request)? If so, let me know.

Linda

0 Kudos
Steven_L_Intel1
Employee
1,030 Views
Yes - file an issue with Intel Premier Support with the report type of Feature Request.
0 Kudos
lklawrie1
Beginner
1,030 Views
Will they want an example file for this one?
Linda
0 Kudos
Steven_L_Intel1
Employee
1,030 Views
It would certainly help.
0 Kudos
Reply