[vlc-devel] [PATCH 1/2] Use standard error codes

Rémi Denis-Courmont remi at remlab.net
Mon May 20 13:39:41 CEST 2019


Hi,

The OS is free to represent error codes however it wants. In fact, negative values are probably the most common representation, for the same reason that VLC uses negative values.

The ISO C runtime maps them to positive values unfortunately. In fact, passing negative values to strerror() is UB.

The libav code looks like somebody tried to support a freestanding implementation, but VLC never supported that.

Le 20 mai 2019 09:48:16 GMT+03:00, Jean-Baptiste Kempf <jb at videolan.org> a écrit :
>On Sun, 19 May 2019, at 19:46, Rémi Denis-Courmont wrote:
>> While this is not complete nor free of ambiguities, this enables a
>lot
>> more expressive error values than the current tiny set. And even
>then,
>> mostly only VLC_EGENERIC and VLC_ENOMEM are ever used.
>
>I don't think this is correct.
>
>This will break several OSes, notably Haiku, for no good reason. They
>have negative error numbers.
>This will make them positive. You need to use the same macro libav,
>ffmpeg or dav1d have, for this reason.
>
>-- 
>Jean-Baptiste Kempf -  President
>+33 672 704 734
>_______________________________________________
>vlc-devel mailing list
>To unsubscribe or modify your subscription options:
>https://mailman.videolan.org/listinfo/vlc-devel

-- 
Envoyé de mon appareil Android avec Courriel K-9 Mail. Veuillez excuser ma brièveté.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20190520/4ddefcd1/attachment.html>


More information about the vlc-devel mailing list