#131 Can't build on NetBSD 4.0

1.4.x
open
5
2016-06-12
2008-04-16
OBATA Akio
No

On NetBSD 4.0, failed to build scim-1.4.7.

scim_chartraits.cpp:44: error: no member function 'assign' declared in 'std::char_traits<unsigned int>'
scim_chartraits.cpp:44: error: invalid function declaration
(and same errors)...

NetBSD 4.0 is not __STDC_ISO_10646__ and GCC 4.1.2.
(NetBSD 3 is gcc 3.3.3, build fine)

How to fix this problem?

It seems that following code in scim_types.h.in avoid this error on FreeBSD.

#ifdef __FreeBSD__
# include <osreldate.h>
# if __FreeBSD_version > 500035
# define __STDC_ISO_10646__
# endif
#endif

This is not reflect reality.
Probably, it is originally here:
http://www.freebsd.org/cgi/query-pr.cgi?pr=69777
It does not means that FreeBSD 5 is __STDC_ISO_10649, but just workaround of build failor with GCC>=3.4.

This error due to std::char_traits in GNU ISO C++ Library included in newer gcc only accept 'class'.
At least, C++ Library in GCC4.1.2 have __gnu_cxx::char_traits, it accept none-class, accept uint32.

After apply following patch, succeed to build on NetBSD 4.0 and it seems to be able to use with scim-anthy:

--- src/scim_chartraits.cpp.orig 2007-06-26 14:31:38.000000000 +0000
+++ src/scim_chartraits.cpp
@@ -36,7 +36,11 @@ using namespace scim;

#if !defined(__STDC_ISO_10646__) && GCC_VERSION >= 30200

+#if GCC_VERSION >= 30400
+namespace __gnu_cxx
+#else
namespace std
+#endif
{

template<>

But I don't know to what functions char_traits affect.
Are there any test case to confirm the function?

Discussion

  • Rolf

    Rolf - 2011-08-17

    Is this still an issue with 1.4.11?

     
  • OBATA Akio

    OBATA Akio - 2011-08-17

    Our solution for this issue for scim-1.4.9 is here (as already posted here, scim-1.4.10 and 1.4.11 are broken for me, and I cannot find any changes for this issue):

    http://cvsweb.netbsd.org/bsdweb.cgi/pkgsrc/inputmethod/scim/patches/

    For this issue, patch-ab and patch-ah.
    Update Implementation for !__STDC_IOS_10646__, then move it from .scim_chartraits.cpp to .scim_types.h.in.

     
  • Rolf

    Rolf - 2011-09-12
    • assigned_to: suzhe --> nobody
     
  • Rolf

    Rolf - 2011-09-12
    • assigned_to: nobody --> leggewie
     
  • Rolf

    Rolf - 2011-09-12

    Thank you for providing that link. I shall have a look through those patches and apply them as appropriate. Please feel free to remind me in about a month's time if you don't hear back. I tend to be forgetful ;-)

     
  • Rolf

    Rolf - 2012-09-19

    wow, it's been another YEAR! and of course I forgot. Mea culpa.

     
  • Rolf

    Rolf - 2012-09-19

    Tz-Huan, maybe you can review these patches? Let me know if you need help or are generally unable to do the review.

     
  • Rolf

    Rolf - 2012-09-19
    • assigned_to: leggewie --> tzhuan
     
  • Tz-Huan Huang

    Tz-Huan Huang - 2012-09-21

    I have scanned all patches from NetBSD (http://ftp.netbsd.org/pub/pkgsrc/current/pkgsrc/inputmethod/scim/patches/) and picked up those which are relevant I think. However, I decide not to include this one because of two reasons: 1. NetBSD is 5.1.2 now, I think the default version of gcc in NetBSD-5 should have no such problem; 2. I want to let scim confirm the standard (both in language such as C and C++, and platform such as POSIX), so in general I don't plan to include patches for specific compiler/platform if there is no good reason. If NetBSD still have this problem, I'll try to find a portable way to work for (almost) all platform.

     
  • Rolf

    Rolf - 2012-09-21

    Thanks, Tz-Huan.

    Obache-San, can you please verify if this problem is still relevant in the latest version of NetBSD?

     
  • OBATA Akio

    OBATA Akio - 2012-09-22

    still same errors even with NetBSD-5.1.2.

    Please try to build without __STDC_ISO_10646__ knob, and you can reproduce this issue,
    current SCIM is for only wchar_t == UCS4 platforms .
    And our patches are not for NetBSD/gcc (platform) specific , using standard way,
    because pkgsrc is used with various platforms/compilers.

     
  • Tz-Huan Huang

    Tz-Huan Huang - 2012-09-22

    Obata Akio, thanks very much for your report. I pushed a new commit, could you please get the latest source from https://github.com/scim-im/scim and try it again? I can compile the core part (./configure --disable-gtk2-immodule --disable-gtk3-immodule --disable-qt3-immodule --disable-qt4-immodule --diable-panel-gtk --disable-setup-ui) without any patches in my NetBSD VM (i386 5.1.2 with pkgsrc-2012Q2), but I cannot test gtk part because I cannot build libXext, which is required by gtk/gdk.

    I tested it on NetBSD only. If you find that it breaks on other platform, please tell me. I'll try to fix it.

     
  • Rolf

    Rolf - 2016-06-09

    Obata-san, is this problem fixed now?

     
  • OBATA Akio

    OBATA Akio - 2016-06-12

    It is hard to reproduce the issue because underlying components require modern compilers now.

    In current code, WideString users include "scim_types.h", and don't know about std::char_traints<ucs4_t> in "scim_char_traits.cpp".
    "scim_char_traits.cpp" produces nothing because declarerd template is not used in the scope.

    If it is built find on the platform, buitin std::char_traints<ucs4_t> template in system header file is used and I'm not sure whether it is suitable for SCIM usage.
    If it is ture, you can get rid of scim_char_traits.cpp safely.

     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks