VOGONS


ODR violation

Topic actions

First post, by realnc

User metadata
Rank Oldbie
Rank
Oldbie

I found an ODR violation when I tried to build dosbox (current SVN trunk) with LTO (link time optimization.) It's the STRING_OP enum which has two different definitions. One in src/cpu/core_dyn_x86/string.h and the other in src/cpu/core_normal/string.h. When building with LTO, you can end up with the definition from core_normal being used for core_dyn_x86 or vice versa (it's undefined which one will be picked.)

I applied the attached trivial patch to fix it. It just renames the enums.

Attachments

  • Filename
    odr-fix.diff
    File size
    1.2 KiB
    Downloads
    75 downloads
    File license
    Public domain