possible bug
Paul Bibbings
paul.bibbings@tesco.net
Sat May 20 11:40:00 GMT 2000
This is a bug report for RHIDE Version 1.4.7.6 (Apr
14 2000 18:44:41) I am running MS-DOS 7.10
ÃÂ
Important environment
variables: PATH=C:\WINDOWS;C:\WINDOWS;C:\WINDOWS\COMMAND;C:\DJGPP\BIN;C:\PROGRA~1\BORLAND\CBUILDER\BIN;C:\LCLINT\BIN;C:\JDK1.2\BIN;C:\PROGRA~1\BORLAND\CBUILD~1\PROJECTS\BPL;C:\BORLAND\BCC55\BIN;C:\PROGRA~1\BORLAND\CBUILD~1\BIN;C:\MSDEV\BIN;C:\PROGRA_1\BORLAND\DELPHI~3\BIN;C:\PP\BIN\WIN32;C:\PERL\BIN;C:\PROGRA~1\BORLAN~1\CBUILDER\BIN DJGPP=C:\DJGPP\DJGPP.ENV DJDIR=c:/djgpp LFN=y INFOPATH=c:/djgpp/info;c:/djgpp/gnu/emacs/info LOCALEDIR= LANGUAGE= SHELL= COMSPEC=C:\COMMAND.COM DJSYSFLAGS=
ÃÂ
Here is the output from a sample compilation and
link for C executing: echo "int main(){return 0;}" | redir -eo gcc
-Xlinker -v -Wa,-v -v -o /dev/null -x c - Reading specs from
c:/djgpp/lib/gcc-lib/djgpp/2.952/specs gcc version 2.95.2 19991024
(release) ÃÂ c:/djgpp/lib/gcc-lib/djgpp/2.952/cpp.exe -lang-c -v
-D__GNUC__=2 -D__GNUC_MINOR__=95 -Dunix -Di386 -DGO32 -DDJGPP=2 -DMSDOS
-D__unix__ -D__i386__ -D__GO32__ -D__DJGPP__=2 -D__MSDOS__ -D__unix -D__i386
-D__GO32 -D__DJGPP=2 -D__MSDOS -Asystem(unix) -Asystem(msdos) -Acpu(i386)
-Amachine(i386) -Acpu(i386) -Amachine(i386) -Di386 -D__i386 -D__i386__
-D__tune_pentium__ -imacros c:/djgpp/lib/../include/sys/version.h -remap -
c:/djgpp/tmp/RHbbaaaa\ccaQ1rJg.i GNU CPP version 2.95.2 19991024 (release)
(80386, BSD syntax) #include "..." search starts here: #include
<...> search starts
here: ÃÂ c:/djgpp/include ÃÂ c:/djgpp/include ÃÂ c:/djgpp/lib/gcc-lib/djgpp/2.952/include ÃÂ c:/djgpp/include End
of search list. The following default directories have been omitted from the
search
path: ÃÂ $DJDIR/lang/cxx ÃÂ $DJDIR/lib/gcc-lib/djgpp/2.952/../../../../djgpp/include End
of omitted list. ÃÂ c:/djgpp/lib/gcc-lib/djgpp/2.952/cc1.exe
c:/djgpp/tmp/RHbbaaaa\ccaQ1rJg.i -quiet -dumpbase -.c -version -o
c:/djgpp/tmp/RHbbaaaa\ccotSjCq.s GNU C version 2.95.2 19991024 (release)
(djgpp) compiled by GNU C version 2.95.2 19991024 (release). :1: parse error
before string constant
ÃÂ
End of the sample
ÃÂ
Here is the output from a sample compilation and
link for C++ executing: echo "int main(){return 0;}" | redir -eo gcc
-Xlinker -v -Wa,-v -v -o /dev/null -x c++ - Reading specs from
c:/djgpp/lib/gcc-lib/djgpp/2.952/specs gcc version 2.95.2 19991024
(release) ÃÂ c:/djgpp/lib/gcc-lib/djgpp/2.952/cpp.exe -lang-c++ -v
-D__GNUC__=2 -D__GNUG__=2 -D__GNUC_MINOR__=95 -D__cplusplus -Dunix -Di386 -DGO32
-DDJGPP=2 -DMSDOS -D__unix__ -D__i386__ -D__GO32__ -D__DJGPP__=2 -D__MSDOS__
-D__unix -D__i386 -D__GO32 -D__DJGPP=2 -D__MSDOS -Asystem(unix) -Asystem(msdos)
-Acpu(i386) -Amachine(i386) -D__EXCEPTIONS -Acpu(i386) -Amachine(i386) -Di386
-D__i386 -D__i386__ -D__tune_pentium__ -imacros
c:/djgpp/lib/../include/sys/version.h -remap -
c:/djgpp/tmp/RHbbaaaa\cc0P0bqi.ii GNU CPP version 2.95.2 19991024 (release)
(80386, BSD syntax) #include "..." search starts here: #include
<...> search starts
here: ÃÂ c:/djgpp/include ÃÂ c:/djgpp/lang/cxx ÃÂ c:/djgpp/include ÃÂ c:/djgpp/lang/cxx ÃÂ c:/djgpp/lib/gcc-lib/djgpp/2.952/include ÃÂ c:/djgpp/include End
of search list. The following default directories have been omitted from the
search
path: ÃÂ $DJDIR/lib/gcc-lib/djgpp/2.952/../../../../djgpp/include End
of omitted list. ÃÂ c:/djgpp/lib/gcc-lib/djgpp/2.952/cc1plus.exe
c:/djgpp/tmp/RHbbaaaa\cc0P0bqi.ii -quiet -dumpbase -.cc -version -o
c:/djgpp/tmp/RHbbaaaa\ccuYzq8y.s GNU C++ version 2.95.2 19991024 (release)
(djgpp) compiled by GNU C version 2.95.2 19991024 (release). :1: parse error
before string constant
ÃÂ
End of the sample
ÃÂ
ÃÂ
ÃÂ
My problem is the
following: ============================
ÃÂ
In trying to compile the following simple program
which uses an array of method pointers -
ÃÂ
********************************************************************* *PROGRAM *********************************************************************
ÃÂ
#include <iostream>
ÃÂ
enum BOOL {FALSE, TRUE};
ÃÂ
class Dog { ÃÂ ÃÂ
public: ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ void Speak() const {cout <<
"Woof!\n";} ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ void Move() const {cout <<
"Walking to heel...\n";} ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ void Eat() const
{cout << "Gobbling food...\n";} ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ void
Growl() const {cout << "Grrrrrrr\n";} ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ
void Whimper() const {cout << "Whining
noises...\n";} ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ void RollOver() const {cout
<< "Rolling over...\n";} ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ void PlayDead()
const {cout << "Is this the end of Caesar?\n";} };
ÃÂ
typedef void (Dog::*PDF)() const;
ÃÂ
int main() { ÃÂ ÃÂ const int max_funcs
= 7;
ÃÂ
ÃÂ ÃÂ PDF dog_functions[max_funcs]
= ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ {
Dog::Speak, ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ
Dog::Move, ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ
Dog::Eat, ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ
Dog::Growl, ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ
Dog::Whimper, ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ
Dog::RollOver, ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ
Dog::PlayDead ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ
};ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ //
this is line 33 where
the ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ //
compiler flags the error.
ÃÂ
ÃÂ ÃÂ Dog *pDog; ÃÂ ÃÂ int
Method;
ÃÂ
ÃÂ ÃÂ while(1) ÃÂ ÃÂ
{ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ cout << "Choose - " <<
endl; ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ cout << "\t(0) Quit;" <<
endl; ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ cout << "\t(1) Speak;" <<
endl; ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ cout << "\t(2) Move;" <<
endl; ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ cout << "\t(3) Eat;" <<
endl; ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ cout << "\t(4) Growl;" <<
endl; ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ cout << "\t(5) Whimper;" <<
endl; ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ cout << "\t(6) Roll Over;"
<< endl; ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ cout << "\t(7) Play
Dead;" << endl; ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ cout << "\t\t\t:
";
ÃÂ
ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ cin >>
Method; ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ if(Method == 0 || Method >
7) ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ
break; ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ else ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ
{ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ pDog = new
Dog; ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ
(pDog->*dog_functions[Method -
1])(); ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ delete
pDog; ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ } ÃÂ ÃÂ }
ÃÂ
ÃÂ ÃÂ return 0; }
ÃÂ
********************************************************************* *END
OF
PROGRAM *********************************************************************
ÃÂ
... I recieve the following error messages,
although it nevertheless compiles fine using Borland C++ Compiler
5.5.
ÃÂ
********************************************************************* *COMPILER
OUTPUT *********************************************************************
ÃÂ
c:\c__pro~1\array_~5.cpp: In function `int
main()': c:\c__pro~1\array_~5.cpp:33: assuming & on
`Dog::Speak' c:\c__pro~1\array_~5.cpp:33: assuming & on
`Dog::Move' c:\c__pro~1\array_~5.cpp:33: assuming & on
`Dog::Eat' c:\c__pro~1\array_~5.cpp:33: assuming & on
`Dog::Growl' c:\c__pro~1\array_~5.cpp:33: assuming & on
`Dog::Whimper' c:\c__pro~1\array_~5.cpp:33: assuming & on
`Dog::RollOver' c:\c__pro~1\array_~5.cpp:33: assuming & on
`Dog::PlayDead' c:\c__pro~1\array_~5.cpp:33: Internal compiler error in
`const_hash', at varasm.c:2372 Please submit a full bug report. See < URL:http://www.gnu.org/software/gcc/faq.html#bugreport >
for instructions.
ÃÂ
Hope this means something to you
ÃÂ
cheers,
Paul Bibbings.
ÃÂ
More information about the Gcc-bugs
mailing list