[vlc-devel] [PATCH 7/7] config: simplify keycmp
Felix Abecassis
felix.abecassis at gmail.com
Tue May 6 23:28:04 CEST 2014
2014-05-06 22:59 GMT+02:00 Rémi Denis-Courmont <remi at remlab.net>:
> Le mardi 6 mai 2014, 22:37:44 Felix Abecassis a écrit :
>> Do we really need speed here?
>>
>> It avoids an conversion to int after an unsigned overflow.
>
> I believe we depend on the reasonable/GCC modulo behaviour in many paths.
I thought so too, but I've used -fsanitize=integer using clang and
only had a few (4-8) undefined behaviors reported for each run with
audio and subtitles.
> Sometimes it is even more or less enforced by the underlying libraries. For
> instance, iconv() returns (size_t)-1 on error.
This looks like a different situation since iconv returns size_t, the
result of the conversion is well defined and I think this is actually
a portable way to set all bits to 1.
>
> So even though I cannot find any such warranty in POSIX, I think we should
> continue to rely on the GCC behaviour for lack of any reasonable alternative.
--
Félix Abecassis
http://felix.abecassis.me
More information about the vlc-devel
mailing list