the following patch needs to be applied to the ncurses source to build with gcc3 (in fact with every stl-compliant c++ system) ported forward from ncurses-4.2 patch provided by SuSE --- c++/cursesw.cc2 Fri May 17 18:02:23 2002 +++ c++/cursesw.cc Fri May 17 18:03:36 2002 @@ -36,6 +36,12 @@ long NCursesWindow::count = 0L; bool NCursesWindow::b_initialized = FALSE; +#if (__GNUG__ >=3 ) +#define USE_STDIO_VSCAN 1 +#else +#undef USE_STDIO_VSCAN +#endif + #if defined(__GNUG__) # ifndef _IO_va_list # define _IO_va_list char * @@ -51,8 +57,12 @@ char buf[BUFSIZ]; int result = wgetstr(w, buf); if (result == OK) { - strstreambuf ss(buf, sizeof(buf)); - result = ss.vscan(fmt, (_IO_va_list)args); +#if USE_STDIO_VSCAN + result = (::vsscanf(buf, fmt, args)); +#else + strstreambuf ss(buf, BUFSIZ); + result = ss.vscan(fmt, args); +#endif } va_end(args); return result; @@ -73,8 +83,12 @@ if (result == OK) { result = wgetstr(w, buf); if (result == OK) { - strstreambuf ss(buf, sizeof(buf)); - result = ss.vscan(fmt, (_IO_va_list)args); +#if USE_STDIO_VSCAN + result = (::vsscanf(buf, fmt, args)); +#else + strstreambuf ss(buf, BUFSIZ); + result = ss.vscan(fmt, args); +#endif } } va_end(args);
Uhm ... we have a ncurses version that builds with gcc3 ?
sure. check the last version of 5.2.x
emerge ncurses fails with the following setup: # gcc --version 2.95.3 # grep -v # /etc/make.conf GENTOO_MIRRORS="http://mirrors.sunsite.dk/gentoo http://www.ibiblio.org/pub/Linux/distributions/gentoo" USE="mmx sse apm pcmcia pnp trusted gphoto2 cups slp X opengl xv kde qt qtmt arts evo sdl gd gif jpeg png tiff avi mpeg quicktime alsa dvd xmms oggvorbis flash encode ipv6 pam ssl crypt imap ldap tcpd mozilla mozirc spell truetype xml xml2 pdflib perl berkdb mysql postgres odbc innodb gdbm afs" CHOST="i686-pc-linux-gnu" CFLAGS="-mcpu=i686 -O2 -pipe" CXXFLAGS="-mcpu=i686 -O2 -pipe" CC=gcc-3.1 CXX=g++-3.1 GCJ=gcj-3.1
Yes, and that is why you have to unmask sys-libs/ncurses-5.2.20020511-r1 if you want to use it with gcc3, as it have the needed fixes.