<?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 Re: Shared library and C++ classes in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/shared-library-and-c-classes/m-p/5268588#M655730</link>
    <description>&amp;gt;The class is used all over. Objects of this class are instantiated by the application, and also the member functions are called.&lt;BR /&gt;&lt;BR /&gt;(The word "application" includes ALL load modules used, not just the executable.)&lt;BR /&gt;&lt;BR /&gt;So every place where instantiated needs to be recompiled.&lt;BR /&gt;&lt;BR /&gt;&amp;gt;Does that mean compiler optimizations could also make this harder to check?&lt;BR /&gt;&lt;BR /&gt;You can get inlining without optimizing.  So either the inline keyword, inlining due to optimization in the same file or cross module inlining.&lt;BR /&gt;&lt;BR /&gt;&amp;gt;is there a possibility of any problems if a non-virtual function is added?&lt;BR /&gt;&lt;BR /&gt;No, since to access it, you would need to have the code changed anyway.&lt;BR /&gt;&lt;BR /&gt;&amp;gt;what is difference internally in adding a virtual function at that end and at some other place?&lt;BR /&gt;&lt;BR /&gt;Existing code uses a fixed offset to access the function descriptor in the virtual table and not a symbolic name.  So if something is added in the middle, virtual calls will call the wrong function.</description>
    <pubDate>Fri, 07 Jan 2011 08:13:18 GMT</pubDate>
    <dc:creator>Dennis Handly</dc:creator>
    <dc:date>2011-01-07T08:13:18Z</dc:date>
    <item>
      <title>Shared library and C++ classes</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shared-library-and-c-classes/m-p/5268585#M655727</link>
      <description>Consider there is some change to a class which is a part of a shared library. Changes may include addition of a new function(virtual or non-virtual),addition of a new data member etc.&lt;BR /&gt;&lt;BR /&gt;Could someone please explain in which all cases  re-compilation/re-link of the applications using the shared library is required?&lt;BR /&gt;&lt;BR /&gt;It will be great if someone can point me to any document regarding the same.&lt;BR /&gt;&lt;BR /&gt;Thanks in advance.</description>
      <pubDate>Thu, 06 Jan 2011 10:36:29 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shared-library-and-c-classes/m-p/5268585#M655727</guid>
      <dc:creator>Nithin Jose</dc:creator>
      <dc:date>2011-01-06T10:36:29Z</dc:date>
    </item>
    <item>
      <title>Re: Shared library and C++ classes</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shared-library-and-c-classes/m-p/5268586#M655728</link>
      <description>The C++ ODR rule says you must recompile everything that uses that class.  It appears you want to cheat.&lt;BR /&gt;&lt;BR /&gt;Is that class only used in the shlib or all over?&lt;BR /&gt;&lt;BR /&gt;Note: The use of inline functions may make any of these harder to check.&lt;BR /&gt;&lt;BR /&gt;1) If you add a new data member, then all places where you create/copy/assign an object must be recompiled.  Places where you access that member obviously must be recompiled.&lt;BR /&gt;&lt;BR /&gt;2) Adding a non-virtual function should be ok.&lt;BR /&gt;&lt;BR /&gt;3) Adding a new virtual function will cause problems if not at the end.  If at the end, then the key function must be recompiled.</description>
      <pubDate>Thu, 06 Jan 2011 10:47:37 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shared-library-and-c-classes/m-p/5268586#M655728</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2011-01-06T10:47:37Z</dc:date>
    </item>
    <item>
      <title>Re: Shared library and C++ classes</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shared-library-and-c-classes/m-p/5268587#M655729</link>
      <description>Hi Dennis,&lt;BR /&gt;&lt;BR /&gt;Thank you for the prompt response.&lt;BR /&gt;&lt;BR /&gt;&amp;gt;&amp;gt;Is that class only used in the shlib or all over?&lt;BR /&gt;&lt;BR /&gt;The class is used all over. Objects of this class are instantiated by the application, and also the member functions are called.&lt;BR /&gt;&lt;BR /&gt;&amp;gt;&amp;gt;Note: The use of inline functions may make any of these harder to check.&lt;BR /&gt;&lt;BR /&gt;Does that mean compiler optimizations could also make this harder to check?&lt;BR /&gt;&lt;BR /&gt;&amp;gt;&amp;gt;Adding a non-virtual function should be ok&lt;BR /&gt;&lt;BR /&gt;If the class has some other virtual functions, then is there a possibility of any problems if a non-virtual function is added? &lt;BR /&gt;&lt;BR /&gt;Also what is difference internally in adding a virtual function at that end and at some other place?&lt;BR /&gt;&lt;BR /&gt;Thanks in advance.&lt;BR /&gt;</description>
      <pubDate>Thu, 06 Jan 2011 11:13:29 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shared-library-and-c-classes/m-p/5268587#M655729</guid>
      <dc:creator>Nithin Jose</dc:creator>
      <dc:date>2011-01-06T11:13:29Z</dc:date>
    </item>
    <item>
      <title>Re: Shared library and C++ classes</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shared-library-and-c-classes/m-p/5268588#M655730</link>
      <description>&amp;gt;The class is used all over. Objects of this class are instantiated by the application, and also the member functions are called.&lt;BR /&gt;&lt;BR /&gt;(The word "application" includes ALL load modules used, not just the executable.)&lt;BR /&gt;&lt;BR /&gt;So every place where instantiated needs to be recompiled.&lt;BR /&gt;&lt;BR /&gt;&amp;gt;Does that mean compiler optimizations could also make this harder to check?&lt;BR /&gt;&lt;BR /&gt;You can get inlining without optimizing.  So either the inline keyword, inlining due to optimization in the same file or cross module inlining.&lt;BR /&gt;&lt;BR /&gt;&amp;gt;is there a possibility of any problems if a non-virtual function is added?&lt;BR /&gt;&lt;BR /&gt;No, since to access it, you would need to have the code changed anyway.&lt;BR /&gt;&lt;BR /&gt;&amp;gt;what is difference internally in adding a virtual function at that end and at some other place?&lt;BR /&gt;&lt;BR /&gt;Existing code uses a fixed offset to access the function descriptor in the virtual table and not a symbolic name.  So if something is added in the middle, virtual calls will call the wrong function.</description>
      <pubDate>Fri, 07 Jan 2011 08:13:18 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shared-library-and-c-classes/m-p/5268588#M655730</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2011-01-07T08:13:18Z</dc:date>
    </item>
    <item>
      <title>Re: Shared library and C++ classes</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shared-library-and-c-classes/m-p/5268589#M655731</link>
      <description>Thanks a lot for the information.</description>
      <pubDate>Wed, 12 Jan 2011 11:35:07 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shared-library-and-c-classes/m-p/5268589#M655731</guid>
      <dc:creator>Nithin Jose</dc:creator>
      <dc:date>2011-01-12T11:35:07Z</dc:date>
    </item>
    <item>
      <title>Re: Shared library and C++ classes</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shared-library-and-c-classes/m-p/5268590#M655732</link>
      <description>Dennis provided the required information I was looking for.</description>
      <pubDate>Wed, 12 Jan 2011 11:36:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shared-library-and-c-classes/m-p/5268590#M655732</guid>
      <dc:creator>Nithin Jose</dc:creator>
      <dc:date>2011-01-12T11:36:33Z</dc:date>
    </item>
  </channel>
</rss>

