<html><head></head><body>Hi,<br><br>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.<br><br>The ISO C runtime maps them to positive values unfortunately. In fact, passing negative values to strerror() is UB.<br><br>The libav code looks like somebody tried to support a freestanding implementation, but VLC never supported that.<br><br><div class="gmail_quote">Le 20 mai 2019 09:48:16 GMT+03:00, Jean-Baptiste Kempf <jb@videolan.org> a écrit :<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<pre class="k9mail">On Sun, 19 May 2019, at 19:46, Rémi Denis-Courmont wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #729fcf; padding-left: 1ex;">While this is not complete nor free of ambiguities, this enables a lot<br>more expressive error values than the current tiny set. And even then,<br>mostly only VLC_EGENERIC and VLC_ENOMEM are ever used.<br></blockquote><br>I don't think this is correct.<br><br>This will break several OSes, notably Haiku, for no good reason. They have negative error numbers.<br>This will make them positive. You need to use the same macro libav, ffmpeg or dav1d have, for this reason.<br></pre></blockquote></div><br>-- <br>Envoyé de mon appareil Android avec Courriel K-9 Mail. Veuillez excuser ma brièveté.</body></html>