[x265] Catch exceptions in main()?

Rafaël Carré funman at videolan.org
Wed Sep 18 20:35:47 CEST 2013


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.


More information about the x265-devel mailing list