This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: possible bug


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.

 

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]