Menu

#22 Unbreak the build against Clang

None
closed-fixed
nobody
None
5
2017-03-04
2013-12-25
No

Fix some sloppy C++ coding which upsets Clang.

1 Attachments

Discussion

  • Davy Durham

    Davy Durham - 2013-12-27

    These issues have previously been fixed in svn trunk/

    Have you tried trunk? Please close this ticket if you find the problems already fixed.

    I just built against clang++3.0 without failure.

     

    Last edit: Davy Durham 2013-12-27
  • Alexey Dokuchaev

    Some bugs still remain in version 0.13.1beta, file src/PoolFile/TPoolFile.cpp, missing const specifier. Simple patch:

    @@ -575,7 +575,7 @@ template<class l_addr_t,class p_addr_t>
            invalidateAllCachedBlocks(false,poolId);
    
            // remove poolName with poolId of the parameter
    -       for(map<string,poolId_t>::const_iterator t=...)
    +       for(map<const string,poolId_t>::const_iterator t=...)
            {
                    if(t->second==poolId)
                    {
    

    Another minor problem: #include <string> is missing in src/backend/CTrigger.h, simple fix:

    @@ -27,6 +27,7 @@
     #include <stddef.h>
    
     #include <stdexcept>
    +#include <string>
     #include <vector>
    
     #include <CMutex.h>
    

    However, ReZound still does not link with Clang, with the following error:

    libtool: link: c++ -I/usr/local/include/fox-1.6 -g -Wall -std=c++0x -Wno-unused-function -Wno-unused-variable -Wno-unused -fexceptions -f
    color-diagnostics -Wl,-lpthread -Wl,--allow-multiple-definition -o rezound main.o  -L/usr/local/lib ./.libs/libfrontend.a ../../src/backe
    nd/.libs/libbackend.a -laudiofile /usr/local/lib/libjack.so /usr/local/lib/libogg.so /usr/local/lib/libvorbisfile.so /usr/local/lib/libvo
    rbisenc.so /usr/local/lib/libvorbis.so /usr/local/lib/libFLAC++.so /usr/local/lib/libFLAC.so -lfftw3 ../../src/backend/File/.libs/libFile
    .a ../../src/backend/Edits/.libs/libEdits.a ../../src/backend/Effects/.libs/libEffects.a ../../src/backend/Filters/.libs/libFilters.a ../
    ../src/backend/Looping/.libs/libLooping.a ../../src/backend/Remaster/.libs/libRemaster.a -lSoundTouch ../../src/backend/Generate/.libs/li
    bGenerate.a ../../src/backend/LADSPA/.libs/libLADSPA.a ../../src/misc/CNestedDataFile/.libs/libmiscCN.a ../../src/PoolFile/.libs/libPoolF
    ile.a ../../src/misc/.libs/libmisc.a -lFOX-1.6 /usr/local/lib/libX11.so /usr/local/lib/libXext.so /usr/local/lib/libfreetype.so /usr/local/lib/libXft.so /usr/local/lib/libXcursor.so /usr/local/lib/libXrender.so /usr/local/lib/libXrandr.so /usr/local/lib/libXfixes.so /usr/local/lib/libXi.so -lrt /usr/local/lib/libjpeg.so -lpng /usr/local/lib/libtiff.so -lz -lbz2 -lGLU -lGL -lportaudio -lpthread -lm -pthread -Wl,-rpath -Wl,/usr/local/lib -Wl,-rpath -Wl,/usr/local/lib
    ./.libs/libfrontend.a(settings.o): In function `std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const anytype_to_string<bool>(std::__1::vector<bool, std::__1::allocator<bool> > const&)':
    /tmp/usr/ports/audio/rezound/work/rezound-0.13.1beta/src/frontend_fox/../../src/misc/CNestedDataFile/anytype.h:162: undefined reference to `std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const anytype_to_string<std::__1::__bit_const_reference<std::__1::vector<bool, std::__1::allocator<bool> > > >(std::__1::__bit_const_reference<std::__1::vector<bool, std::__1::allocator<bool> > > const&)'
    c++: error: linker command failed with exit code 1 (use -v to see invocation)
    *** Error code 1
    
    $ c++ -v
    FreeBSD clang version 3.4.1 (tags/RELEASE_34/dot1-final 208032) 20140512
    Target: i386-unknown-freebsd11.0
    Thread model: posix
    Selected GCC installation: 
    
     
  • Alexey Dokuchaev

    Both of these problems still stand for 0.13.1beta.

     
  • Davy Durham

    Davy Durham - 2017-03-04
    • status: open --> closed-fixed
    • Group: -->
     
  • Davy Durham

    Davy Durham - 2017-03-04

    quick fix: now using auto keyword to avoid this problem (at least in TPoolFile.cpp)

     

Log in to post a comment.