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]
Other format: [Raw text]

Re: Exception handling


GCC does not catch hardware exceptions like divide by 0 and other traps.
Look at signal(3) for information on how to trap these on UNIX's.

Thanks,
Andrew Pinski



On Monday, August 26, 2002, at 11:14 , Serguei I. Ivantsov wrote:

Hello!

Please help me with exception handling under gcc

The very simple program:

int main(int argc, char* argv[])
{
printf("Start\n");
try{
printf("Block\n");
int x=0;
int y=0;
int z;
z=x/y;
}catch(...){
printf("Except\n");
};
printf("End\n");
return 0;
}

Execution stops after "Floating point exception" and never riches catch
section.

What is wrong? It is works pretty good under M$ :)


--
 Regards,
  Serguei I. Ivantsov
   GSC Game World









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