<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Yes, that's how it's supposed in Intel® Fortran Compiler</title>
    <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Pointer-to-PROTECTED-variable/m-p/970143#M96960</link>
    <description>Yes, that's how it's supposed to work.  Within the module, you can do anything you want - and if that's to expose the object through a pointer, then you're free to do that. Since the module is where the PROTECTED attribute was given, it is assumed that the module author knows what they're doing.

And in case you wonder - if you make the pointer itself protected, all that means is that the association status of the pointer can't be changed - it doesn't protect what the pointer points to.  This was deliberate and argued at length at standards meetings.</description>
    <pubDate>Tue, 11 Dec 2012 18:45:33 GMT</pubDate>
    <dc:creator>Steven_L_Intel1</dc:creator>
    <dc:date>2012-12-11T18:45:33Z</dc:date>
    <item>
      <title>Pointer to PROTECTED variable</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Pointer-to-PROTECTED-variable/m-p/970138#M96955</link>
      <description>&lt;P&gt;I get the following message when I try to point to a PROTECTED variable from outside of the modele where it is defined:&lt;/P&gt;
&lt;P&gt;A use associated object that has the PROTECTED attribute shall not appear as a target in a pointer-assignment-stmt&lt;/P&gt;
&lt;P&gt;What is the rationale behind disallowing this?&lt;/P&gt;
&lt;P&gt;If I declare a pointer in the module where the PROTECED variable&amp;nbsp;is declared, associate this pointer with the PROTECTED variable, and and then associate the original pointer with the one in the module there is no error. However, now the PROTECTion is also lost and I'm able to reassign the value of the PROTECTED variable.&lt;BR /&gt;Is this intensional, ie. standard conforming, behavior, or is it a bug?&lt;/P&gt;</description>
      <pubDate>Tue, 11 Dec 2012 12:57:49 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Pointer-to-PROTECTED-variable/m-p/970138#M96955</guid>
      <dc:creator>Espen_M_</dc:creator>
      <dc:date>2012-12-11T12:57:49Z</dc:date>
    </item>
    <item>
      <title>The standard says:</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Pointer-to-PROTECTED-variable/m-p/970139#M96956</link>
      <description>The standard says:

C551 A nonpointer object that has the PROTECTED attribute and is accessed by use association shall not appear in a variable definition context or as the data-target or proc-target in a pointer-assignment-stmt.

The idea of PROTECTED is that use outside the module is restricted, but inside the module it is assumed you know what you are doing.</description>
      <pubDate>Tue, 11 Dec 2012 14:55:35 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Pointer-to-PROTECTED-variable/m-p/970139#M96956</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2012-12-11T14:55:35Z</dc:date>
    </item>
    <item>
      <title>So if I have a set of objects</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Pointer-to-PROTECTED-variable/m-p/970140#M96957</link>
      <description>So if I have a set of objects that I want to be constant but I also want to use them as pointees, what do I do? I cannot use PARAMETERs as they are not even variables...
The important thing is that I dont want to accidentally change their values.</description>
      <pubDate>Tue, 11 Dec 2012 15:22:55 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Pointer-to-PROTECTED-variable/m-p/970140#M96957</guid>
      <dc:creator>Espen_M_</dc:creator>
      <dc:date>2012-12-11T15:22:55Z</dc:date>
    </item>
    <item>
      <title>Why must they be pointees?</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Pointer-to-PROTECTED-variable/m-p/970141#M96958</link>
      <description>Why must they be pointees?  Perhaps what you want is to define some access (get) methods that are exposed from the module without exposing the objects themselves.  Once you have a pointer to something, you can change its value.</description>
      <pubDate>Tue, 11 Dec 2012 17:08:05 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Pointer-to-PROTECTED-variable/m-p/970141#M96958</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2012-12-11T17:08:05Z</dc:date>
    </item>
    <item>
      <title>Often a get method will get</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Pointer-to-PROTECTED-variable/m-p/970142#M96959</link>
      <description>Often a get method will get the job done, but sometimes it will cause unnecessary awkwardness and, more often, performance penalty when passing around "constants" that are function result temporaries instead of pointers. I can use pointers to "ordinary" variables, but ideally I'd like to make them read-only for security reasons.

So what about the "security hole" with pointers to pointers to protected variables that I described in the last part of my post? Is this how it is supposed to work?</description>
      <pubDate>Tue, 11 Dec 2012 18:03:26 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Pointer-to-PROTECTED-variable/m-p/970142#M96959</guid>
      <dc:creator>Espen_M_</dc:creator>
      <dc:date>2012-12-11T18:03:26Z</dc:date>
    </item>
    <item>
      <title>Yes, that's how it's supposed</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Pointer-to-PROTECTED-variable/m-p/970143#M96960</link>
      <description>Yes, that's how it's supposed to work.  Within the module, you can do anything you want - and if that's to expose the object through a pointer, then you're free to do that. Since the module is where the PROTECTED attribute was given, it is assumed that the module author knows what they're doing.

And in case you wonder - if you make the pointer itself protected, all that means is that the association status of the pointer can't be changed - it doesn't protect what the pointer points to.  This was deliberate and argued at length at standards meetings.</description>
      <pubDate>Tue, 11 Dec 2012 18:45:33 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Pointer-to-PROTECTED-variable/m-p/970143#M96960</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2012-12-11T18:45:33Z</dc:date>
    </item>
    <item>
      <title>Thank you so much, Steve!</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Pointer-to-PROTECTED-variable/m-p/970144#M96961</link>
      <description>Thank you so much, Steve!</description>
      <pubDate>Thu, 13 Dec 2012 20:37:56 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Pointer-to-PROTECTED-variable/m-p/970144#M96961</guid>
      <dc:creator>Espen_M_</dc:creator>
      <dc:date>2012-12-13T20:37:56Z</dc:date>
    </item>
  </channel>
</rss>

