Why dont RealTime Embedded programmers use Exception Handling?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • noone

    #16
    Re: Why dont RealTime Embedded programmers use Exception Handling?

    You can't use the RAII paradigm without using
    exceptions for the simple reason exceptions are the only way to
    report an error from a constructor.
    Good point, and really the only reason I consider valid for using
    exceptions...bu t we've already covered my bias against them.


    Comment

    • dayton

      #17
      Re: Why dont RealTime Embedded programmers use Exception Handling?

      What do you mean by "Unexpected exception handling in C++"?
      If you use exception signatures on your functions, and if
      exception gets thrown that doesn't match one of the exceptions
      in the signature, the default behavior is to terminate the
      application.

      If you fail to catch an exception, the default behavior is to
      terminate the application. Because C++ allows you to throw
      anything, you'll have to use a catch (...) block at the top-most
      level of your module, but then you'll lose all information
      contained in the exception, and you may not have control over
      the code that calls your code. If you're writing a library,
      terminating the customer's application is a really hostile thing
      to do.

      Glen Dayton

      Comment

      Working...