This is the mail archive of the gcc@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]

Exception handling


Hello,

I need to implement exception handling mechanism in my C++ project. Here is
a simple code i wrote to test that:

#include <stdio.h>
int main()
{
 int *pI;

 pI = 0;
 try {
         int j = *pI;
 }
 catch(...)
 {
  printf("We are still working, core was not dumped.\n");
 }
 return 0;
}

I have installed gcc 2.95.2 and binutils 2.9.5.0.24. When this program is
executed I get segmentation fault at int j = *pI; line. Actually I failed to
"catch" any type exceptions generated in the try block. What is wrong?

Thanks in advance,

================================
  Igor Mukhin

   E-mail: imukhin@tot.ru
   ICQ:     626446
================================



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