<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <meta http-equiv="Content-Style-Type" content="text/css" />
  <meta name="generator" content="pandoc" />
  <title></title>
  <style type="text/css">code{white-space: pre;}</style>
</head>
<body>
<p>Hi Rémi,</p>
<p>On 2017-02-24 00:18, Rémi Denis-Courmont wrote:</p>
<blockquote style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;color:#500050">
<pre><code> Le perjantaina 24. helmikuuta 2017, 0.04.46 EET Rémi Denis-Courmont a écrit :</code></pre>
<blockquote style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;color:#500050">
<pre><code> Le torstaina 23. helmikuuta 2017, 14.54.24 EET Filip Roséen a écrit :</code></pre>
<blockquote style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;color:#500050">
<pre><code> VLC_OBJECT reaches inside the data-members of the passed pointer to
 reach the intrinsic object, so that a pointer to the internal
 vlc_object_t can be created.</code></pre>
</blockquote>
<pre><code> Yes but no. The result is the same however: the compiler assumes that the
 pointer is not NULL.</code></pre>
</blockquote>
<pre><code> Actually yes. The C++ version does -technically- access the object, although 
 the C version does not. But at least, LLVM seems to barf also on the C 
 version; I suspect this is an LLVM bug though.</code></pre>
</blockquote>
<p>Yes, and given that the relevant snippet is always compiled as C++, it does always <em>“technically”</em> dereference the pointer (and with that invoke <em>undefined-behavior</em>).</p>
<p>As I guess is clear after our previous discussions I do not like doing things that the relevant ISO Standard does not consider <em>well-defined</em> (so “technically” is certainly good enough for me).</p>
<blockquote style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;color:#500050">
<blockquote style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;color:#500050">
<pre><code> That said, in this case, you could probably either ensure that the object is 
 always a vlc_object, or simply cast - to avoid the ternary.
 [ src: https://mailman.videolan.org/pipermail/vlc-devel/2017-February/111657.html ]</code></pre>
</blockquote>
</blockquote>
<p>I prefer the way the fix is currently written while we wait for a refactored version that does not include these quirks at all. If the patch is not satisfying enough for the VLC community, please discard it.</p>
<p>Best Regards,<br />
Filip</p>
</body>
</html>