Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 2806 - ncurses has problems with gcc3
Summary: ncurses has problems with gcc3
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: x86 Linux
: High normal (vote)
Assignee: Brandon Low (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-05-17 13:54 UTC by Patrick Mauritz
Modified: 2003-02-04 19:42 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Patrick Mauritz 2002-05-17 13:54:45 UTC
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);
Comment 1 Martin Schlemmer (RETIRED) gentoo-dev 2002-08-06 15:38:52 UTC
Uhm ... we have a ncurses version that builds with gcc3 ?
Comment 2 Spider (RETIRED) gentoo-dev 2002-08-06 17:56:33 UTC
sure.
check the last version of 5.2.x
Comment 3 Ole Tange 2002-08-22 03:33:39 UTC
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
Comment 4 Martin Schlemmer (RETIRED) gentoo-dev 2002-08-22 14:10:48 UTC
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.