[x265] Catch exceptions in main()?

Steve Borho steve at borho.org
Wed Sep 18 20:56:11 CEST 2013


On Wed, Sep 18, 2013 at 1:35 PM, Rafaël Carré <funman at videolan.org> wrote:

> Le 18/09/2013 20:27, Steve Borho a écrit :
> > On Wed, Sep 18, 2013 at 8:33 AM, SF Markus Elfring <
> > elfring at users.sourceforge.net> wrote:
> >
> >> Hello,
> >>
> >> I expect that exception handling is usually supported by a C++ program.
> >> I wonder why your function "main" does not contain corresponding try and
> >> catch
> >> instructions so far.
> >>
> >>
> https://bitbucket.org/multicoreware/x265/src/d11de33521cf/source/x265.cpp#cl-481
> >>
> >> How do you think about descriptions from software developers like the
> >> following?
> >> - Matthew Wilson
> >>   http://accu.org/index.php/journals/1706
> >>
> >> - Danny Kalev
> >>   http://www.informit.com/guides/content.aspx?g=cplusplus&seqNum=108
> >
> >
> > Interesting point.
> >
> > Our library does not define any exceptions, nor does it explicitly throw
> > any.  So the only exceptions emitted by the library will be
> divide-by-zero
> > and other things that indicate bugs that we probably don't want to catch
> > unless there was a way to report a stack trace or something else useful.
> >
> > Most users of x265 will not use our CLI wrapper, they will use us as a
> > library and thus they would need to catch exceptions from our API calls
> at
> > whatever level is appropriate to them.
>
> The library is also usable from C code where exceptions can not be caught.


Yes, very true.  So it really boils do to the question of whether we should
catch them.  And if we do, what should we do with them?

-- 
Steve Borho
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/x265-devel/attachments/20130918/c46dd270/attachment-0001.html>


More information about the x265-devel mailing list