bugGNU Octave - Bugs: bug #51639, 'struct help_system' violates the...

 
 

bug #51639: 'struct help_system' violates the C++ One Definition Rule

Submitter:  Dmitri A. Sergatskov <dasergatskov>
Submitted:  Tue 01 Aug 2017 08:16:38 PM UTC
   
 
Category:  None Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Build Failure
Status:  Fixed Assigned to:  None
Originator Name:  Open/Closed:  * Closed
Release:  * dev Operating System:  * GNU/Linux
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Wed 02 Aug 2017 08:19:03 PM UTC, comment #3: 

Ah, I think the issue is that the real declaration/definition of interpreter is inside the octave namespace but the forward declaration in help.h is not.

Fixed with the following changeset and tested with GCC 7 and lto enabled.  Closing report.

http://hg.savannah.gnu.org/hgweb/octave/rev/5111b1b5034d



John W. Eaton <jwe>
Group administrator
Wed 02 Aug 2017 07:47:49 PM UTC, comment #2: 

I'm looking at this now.  I don't see how it could be OCT_INTERP_API since, as far as I can tell, that macro is currently always defined to be empty on all systems except MSVC.

John W. Eaton <jwe>
Group administrator
Wed 02 Aug 2017 06:40:50 PM UTC, comment #1: 

It's not a killer, but this should be fixed.

Is it fixed if you change llibinterp/corefcn/help.h:33 to


class OCTINTERP_API interpreter


The compiler is pointing out that there are two declarations of the class interpreter, one with OCTINTERP_API and one without.


Rik <rik5>
Group administrator
Tue 01 Aug 2017 08:16:38 PM UTC, original submission:  

I noticed in fedora lto builds (gcc 7.1.1):


libtool: link: ( cd "libinterp/dldfcn/.libs" && rm -f "qr.la" && ln -s "../qr.la" "qr.la" )
/usr/bin/install -c libinterp/dldfcn/.libs/qr.so libinterp/dldfcn/qr.oct
../src/libinterp/corefcn/help.h:39:9: warning: type 'struct help_system' violates the C++ One Definition Rule [-Wodr]
   class help_system
         ^
../src/libinterp/corefcn/help.h:39:9: note: a different type is defined in another translation unit
   class help_system
         ^
../src/libinterp/corefcn/help.h:138:18: note: the first difference of corresponding definitions is field 'm_interpreter'
     interpreter& m_interpreter;
                  ^
../src/libinterp/corefcn/help.h:138:18: note: a field of same name but different type is defined in another translation unit
     interpreter& m_interpreter;
                  ^
../src/libinterp/corefcn/help.h:33:7: note: type name 'interpreter' should match type name 'octave::interpreter'
 class interpreter;
       ^
../src/libinterp/corefcn/interpreter.h:66:23: note: the incompatible type is defined here
   class OCTINTERP_API interpreter
                       ^


See e.g.:



http://buildbot.octave.org:8010/builders/gcc-lto-fedora/builds/640/steps/compile/logs/stdio


Dmitri.

Dmitri A. Sergatskov <dasergatskov>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by jwe (Posted a comment)
  • -email is unavailable- added by rik5 (Posted a comment)
  • -email is unavailable- added by dasergatskov (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2017-08-02 jwe StatusNone Fixed
        Open/ClosedOpen Closed

    Back to the top

    Powered by Savane 3.13-02a9.
    Corresponding source code