title: Visual C++ Unmanaged Code: Use /EHa or /EHsc for C++ exceptions?
body: <p>If I'm creating a new project in unmanaged C++, Visual Studio 2008 or greater, which exception handling model do I want to go with?</p>
  
  <p>I understand that /EHa option results in less efficient code, and also catches SEH exceptions, right?</p>
  
  <p>So I have been steering clear of that option and typically going with /EHsc, so that I'm only catching C++ exceptions that are actually thrown and not catching access violations and other structured execptions, in catch(...) handlers. If there is an access violation in my code, I don't want it being masked by a catch(...) {}.</p>
  
  <p>I code with others who want catch(...) {} to do nothing and they even want it to do it if there is an access violation, which seems like a really bad idea to me. If there is a bug due to bad coding, you don't want to stick your fingers in your ears and loudly say "La la la la la!" so that you don't have to have the program crash? In fact, if the code is now in a bad state because of a coding error, do you really want the code to continue?</p>
  
  <p>So my general thought is that /EHa creates larger/slower code and it allows programmers to get away with writing code that if a fatal bug is present, it will continue to run in an undefined state.</p>
  
  <p>BTW, I'm talking about applications and service code which is what we are writing for the most part. Not low level device drivers or anything like that.</p>
  
  <p>Please weigh in with your thoughts.</p>