glibc 2.10 compatibility

Twelwan
2009-05-27
2013-05-30
  • Twelwan
    Twelwan
    2009-05-27

    Hello there,

    I just realized that some parts of the plugin code do not work with the brand-new glibc 2.10:
    http://udrepper.livejournal.com/20948.html (see "C++ compliance")
    http://gcc.gnu.org/gcc-4.4/porting_to.html (see "Strict null-terminated sequence utilities")

    Being an inexperienced C/C++ programmer myself, I am not able to produce a patch, but for a better description I am posting some of the errors here:

    g++ -O3 -pipe -Wall -Woverloaded-virtual -fPIC -g -c -D_GNU_SOURCE -DPLUGIN_NAME_I18N='"xineliboutput"' -D_REENTRANT -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DXINELIBOUTPUT_VERSION='"1.0.90-cvs"' -Wall -I/usr/src/VDR/include -I/usr/include/qt4 -o config.o config.c
    config.c: In member function ‘bool config_t::SetupParse(const char*, const char*)’:
    config.c:712: error: invalid conversion from ‘const char*’ to ‘char*’

    g++ -O3 -pipe -Wall -Woverloaded-virtual -fPIC -g -c -D_GNU_SOURCE -DPLUGIN_NAME_I18N='"xineliboutput"' -D_REENTRANT -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DXINELIBOUTPUT_VERSION='"1.0.90-cvs"' -Wall -I/usr/src/VDR/include -I/usr/include/qt4 -o menu.o menu.c
    menu.c: In function ‘char* LastDir(const char*)’:
    menu.c:97: error: invalid conversion from ‘const char*’ to ‘char*’
    menu.c: In member function ‘virtual bool cMenuBrowseFiles::ScanDir(const char*)’:
    menu.c:404: error: invalid conversion from ‘const char*’ to ‘char*’

    g++ -O3 -pipe -Wall -Woverloaded-virtual -fPIC -g -c -D_GNU_SOURCE -DPLUGIN_NAME_I18N='"xineliboutput"' -D_REENTRANT -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DXINELIBOUTPUT_VERSION='"1.0.90-cvs"' -Wall -I/usr/src/VDR/include -I/usr/include/qt4 -o setup_menu.o setup_menu.c
    setup_menu.c: In member function ‘void XinelibOutputSetupMenu::tvtime_s::Parse(const char*)’:
    setup_menu.c:472: error: invalid conversion from ‘const char*’ to ‘char*’

    g++ -O3 -pipe -Wall -Woverloaded-virtual -fPIC -g -c -D_GNU_SOURCE -DPLUGIN_NAME_I18N='"xineliboutput"' -D_REENTRANT -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DXINELIBOUTPUT_VERSION='"1.0.90-cvs"' -Wall -I/usr/src/VDR/include -I/usr/include/qt4 -o menuitems.o menuitems.c
    menuitems.c: In member function ‘virtual void cFileListItem::Set()’:
    menuitems.c:177: error: invalid conversion from ‘const char*’ to ‘char*’
    menuitems.c:185: error: invalid conversion from ‘const char*’ to ‘char*’

    g++ -O3 -pipe -Wall -Woverloaded-virtual -fPIC -g -c -D_GNU_SOURCE -DPLUGIN_NAME_I18N='"xineliboutput"' -D_REENTRANT -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DXINELIBOUTPUT_VERSION='"1.0.90-cvs"' -Wall -I/usr/src/VDR/include -I/usr/include/qt4 -o frontend_svr.o frontend_svr.c
    frontend_svr.c: In member function ‘void cXinelibServer::Handle_Control_HTTP(int, const char*)’:
    frontend_svr.c:1401: error: invalid conversion from ‘const char*’ to ‘char*’

    g++ -O3 -pipe -Wall -Woverloaded-virtual -fPIC -g -c -D_GNU_SOURCE -DPLUGIN_NAME_I18N='"xineliboutput"' -D_REENTRANT -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DXINELIBOUTPUT_VERSION='"1.0.90-cvs"' -Wall -I/usr/src/VDR/include -I/usr/include/qt4 -o tools/playlist.o tools/playlist.c
    tools/playlist.c: In constructor ‘cPlaylistItem::cPlaylistItem(const char*)’:
    tools/playlist.c:53: error: invalid conversion from ‘const char*’ to ‘char*’
    tools/playlist.c:58: error: invalid conversion from ‘const char*’ to ‘char*’
    tools/playlist.c: In constructor ‘cPlaylistItem::cPlaylistItem(const char*, const char*, const char*, int)’:
    tools/playlist.c:76: error: invalid conversion from ‘const char*’ to ‘char*’
    tools/playlist.c: In member function ‘int cPlaylist::ReadPlaylist(const char*)’:
    tools/playlist.c:767: error: invalid conversion from ‘const char*’ to ‘char*’
    tools/playlist.c:776: error: invalid conversion from ‘const char*’ to ‘char*’
    tools/playlist.c: In function ‘cString LastDir(cString&)’:
    tools/playlist.c:842: error: invalid conversion from ‘const char*’ to ‘char*’
    tools/playlist.c:845: error: invalid conversion from ‘const char*’ to ‘char*’
    tools/playlist.c: In member function ‘bool cPlaylist::Read(const char*, bool)’:
    tools/playlist.c:861: error: assignment of read-only location ‘*(strrchr(((cPlaylist*)this)->cPlaylist::m_Folder.cString::operator const char*(), 47) + 1u)’
    tools/playlist.c:870: error: invalid conversion from ‘const char*’ to ‘char*’
    tools/playlist.c:878: error: assignment of read-only location ‘* strrchr(((cPlaylist*)this)->cPlaylist::m_Name.cString::operator const char*(), 46)’
    tools/playlist.c:889: error: assignment of read-only location ‘* strrchr(((cPlaylist*)this)->cPlaylist::m_Name.cString::operator const char*(), 47)’

    If there is a workaround, I am happy to hear it, but I think those lines just became illegal C++ code. I am using ArchLinux which is probably (one of) the first distros to use the new glibc version and you may want to address this problem in time.

    The mailing lists seem half-dead, but I hope some of the developers will read this. Cheers!

    Some additional system information:

    gcc (GCC) 4.4.0 20090505 (prerelease)
    Copyright (C) 2009 Free Software Foundation, Inc.
    This is free software; see the source for copying conditions.  There is NO
    warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

    GNU C Library stable release version 2.10.1, by Roland McGrath et al.
    Copyright (C) 2009 Free Software Foundation, Inc.
    This is free software; see the source for copying conditions.
    There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
    PARTICULAR PURPOSE.
    Compiled by GNU CC version 4.4.0 20090505 (prerelease).
    Compiled on a Linux >>2.6.29-ARCH<< system on 2009-05-23.
    Available extensions:
        crypt add-on version 2.1 by Michael Glad and others
        GNU Libidn by Simon Josefsson
        Native POSIX Threads Library by Ulrich Drepper et al
        BIND-8.2.3-T5B
    For bug reporting instructions, please see:
    <http://www.gnu.org/software/libc/bugs.html>.

     
    • Should be fixed in CVS. Thanks for reporting this.

       
      • Twelwan
        Twelwan
        2009-06-05

        Builds again and works fine for me. Great work.