[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
ddd compile problems in strclass.C and PannedGE.C
From: |
Singleton, Larry, NNAD |
Subject: |
ddd compile problems in strclass.C and PannedGE.C |
Date: |
Wed, 11 Jul 2001 09:42:35 -0400 |
using: gcc-3.0, lesstif-0.92.32, xpm-3.4k, gtk+-1.2.10, glib-1.2.10, gdb-5.0
I get the same problem on SCO_SV 3.2v5.0.5, and on SunOS 5.7
When compiling ddd (strclass.C) using the following:
c++ -DHAVE_CONFIG_H -I. -I. -I. -I./.. -isystem
/usr/local/lib/X11R6.3/include -DNDEBUG -O2 -g -W -Wall -trigraphs -c
strclass.C
I get this error message:
strclass.C:1441: no matching function for call to `std::basic_istream<char,
std::char_traits<char> >::clear(int&)'
/usr/local/include/g++-v3/bits/basic_ios.h:94: candidates are: void
std::basic_ios<_CharT, _Traits>::clear(std::_Ios_Iostate =
std::ios_base::goodbit) [with _CharT = char, _Traits =
std::char_traits<char>]
The code segment is question is:
int new_state = s.rdstate();
if (i == 0)
new_state |= ios::failbit;
if (ch == EOF)
new_state |= ios::eofbit;
s.clear(new_state);
return s;
It complains about the above s.clear()
I made the following change, as a rough work around:
int jnk=0;
//int new_state = s.rdstate();
if (i == 0)
{
//new_state |= ios::failbit;
s.clear(ios::failbit|s.rdstate());
jnk=1;
}
if (ch == EOF)
{
//new_state |= ios::eofbit;
s.clear(ios::eofbit|s.rdstate());
jnk=1;
}
if (jnk==0)
s.clear(s.rdstate());
return s;
This now compiles strclass.C properly.
However, the next error is:
c++ -DHAVE_CONFIG_H -I. -I. -I. -I./.. -isystem /usr/openwin/include
-DNDEBUG -O2 -g -W -Wall -trigraphs -c PannedGE.C
PannedGE.C: At global scope:
PannedGE.C:143: cannot convert `void (*)(...)' to `void (*)()' in
initialization
make: *** [PannedGE.o] Error 1
I'm not quite sure how to fix this one.
Line 143 is the closing brace to the struct:
struct _PannedGraphEditClassRec pannedGraphEditClassRec
I'm not sure where the initialization type cast is failing.
It seems that gcc-3.0 requires more explicit type casting than previous
versions.
Let me know if there is a way around.
Thanks,
Larry S.
- ddd compile problems in strclass.C and PannedGE.C,
Singleton, Larry, NNAD <=