- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
When I compile the attached simple program with all diagnostic and error checking enabled, there are no messages displayed. However, the program might be violating the Fortran standard.
From Fortran 2008 standard, page 100:
5.3.15 PROTECTED attribute
C551 A nonpointer object that has the PROTECTED attribute and is accessed by use association shall not
appear in a variable definition context ....
Page 456:
16.6.7 Variable definition context
(12) an actual argument in a reference to a procedure with an explicit interface if the corresponding
dummy argument has INTENT (OUT) or INTENT (INOUT);
Roman
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Looks like a 6 legged critter to me but I will leave the verdict to others....
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I agree that the compiler should not have allowed this. I will report it to the developers - thanks. Issue ID is DPD200245966.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
We have fixed this for an update later this year.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Steve! Will a PROTECTED attribute work properly as you answered here – http://software.intel.com/en-us/forums/topic/392997 according to this unfixed error?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Yes, it should. The problem in this thread is that the compiler was inappropriately making an exception for passing a PROTECTED variable into a routine from the module where the variable was declared and where the routine declared the dummy argument as INTENT(OUT) or INTENT(INOUT). PROTECTED is not a foolproof method of preventing module variables from being changed, as you can probably figure out ways around it, but ordinarily it works well enough. If this isn't good enough, then you have to supply a function that returns the value and make that public in the module, not the variable.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I expect the fix for this to appear in the October update

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