<html><head></head><body><div>Hi,</div><div><br></div><div>El mar, 21-08-2018 a las 09:47 -0400, Frediano Ziglio escribió:</div><blockquote type="cite" style="margin:0 0 0 .8ex; border-left:2px #729fcf solid;padding-left:1ex"><pre><blockquote type="cite" style="margin:0 0 0 .8ex; border-left:2px #729fcf solid;padding-left:1ex"></blockquote></pre><pre><br></pre><pre>Hi,</pre><pre><br></pre><pre>On Tue, Aug 21, 2018 at 02:53:59PM +0200, Javier Celaya wrote:</pre><pre><blockquote type="cite" style="margin:0 0 0 .8ex; border-left:2px #729fcf solid;padding-left:1ex"></blockquote></pre><pre><blockquote type="cite" style="margin:0 0 0 .8ex; border-left:2px #729fcf solid;padding-left:1ex"></blockquote></pre><pre>Yes, not against merging the fix. But if we can get it fixed</pre><pre>inGlib, it is matter to help other projects that port code</pre><pre>towindows to be fixed as well, etc.</pre><pre>Please open a bug in Glib and add a reference to it in the</pre><pre>code</pre><pre></pre><pre><br></pre><pre>Are you talking to Jorge or to Frediano (since he has a fixed</pre><pre>macro)?</pre><pre><br></pre><pre>Jorge is on holidays anyway, he will return in a couple of</pre><pre>weeks. I can open the bug report in Glib, but if you already</pre><pre>have a working version of the macro...</pre><pre></pre><pre><br></pre><pre>Either way is fine. If you open a bug, Frediano can attach his</pre><pre>patch there later on.</pre></blockquote><div><br></div><div>I opened the bug report:</div><div><a href="https://gitlab.gnome.org/GNOME/glib/issues/1494">https://gitlab.gnome.org/GNOME/glib/issues/1494</a></div><div><br></div><blockquote type="cite" style="margin:0 0 0 .8ex; border-left:2px #729fcf solid;padding-left:1ex"><pre><br></pre><pre>I just think it is important to have the bug open and a comment</pre><pre>in the code about it. I don't mind patching the code with the</pre><pre>comment so we don't have to wait till Jorge is back ;)</pre><pre><br></pre><pre>Cheers,</pre><pre>Victor</pre><pre><br></pre><pre></pre><pre><br></pre><pre>In the meantime the macro is quite changed, it's now (master)</pre><pre><br></pre><pre>#if defined(g_has_typeof) && GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_58</pre><pre>#define g_clear_pointer(pp, destroy)                                           \</pre><pre>  G_STMT_START {                                                               \</pre><pre>    G_STATIC_ASSERT (sizeof *(pp) == sizeof (gpointer));                       \</pre><pre>    __typeof__(*(pp)) _ptr = *(pp);                                            \</pre><pre>    *(pp) = NULL;                                                              \</pre><pre>    if (_ptr)                                                                  \</pre><pre>      (destroy) (_ptr);                                                        \</pre><pre>  } G_STMT_END</pre><pre>#else /* __GNUC__ */</pre><pre>#define g_clear_pointer(pp, destroy) \</pre><pre>  G_STMT_START {                                                               \</pre><pre>    G_STATIC_ASSERT (sizeof *(pp) == sizeof (gpointer));                       \</pre><pre>    /* Only one access, please; work around type aliasing */                   \</pre><pre>    union { char *in; gpointer *out; } _pp;                                    \</pre><pre>    gpointer _p;                                                               \</pre><pre>    /* This assignment is needed to avoid a gcc warning */                     \</pre><pre>    GDestroyNotify _destroy = (GDestroyNotify) (destroy);                      \</pre><pre>                                                                               \</pre><pre>    _pp.in = (char *) (pp);                                                    \</pre><pre>    _p = *_pp.out;                                                             \</pre><pre>    if (_p)                                                                    \</pre><pre>      {                                                                        \</pre><pre>        *_pp.out = NULL;                                                       \</pre><pre>        _destroy (_p);                                                         \</pre><pre>      }                                                                        \</pre><pre>  } G_STMT_END</pre><pre>#endif /* __GNUC__ */</pre><pre><br></pre><pre>so the first definition is good, calling directly destroy function,</pre><pre>on the second definition is ignoring the calling convention so basically</pre><pre>changing compiler you can have the bug or not.</pre><pre><br></pre><pre>The fix for the convention problem is to just call destroy without</pre><pre>converting it to GDestroyNotify (a void* should be fine in C although</pre><pre>in C++ won't work).</pre><pre><br></pre><pre>The 2 definitions are also incoherent, one is using pp once the other</pre><pre>twice so changing compilers you can have other side effects (note the</pre><pre>"Only one access, please" comment).</pre><pre><br></pre><pre>Frediano</pre><pre><br></pre></blockquote><div><span><pre>-- <br></pre>


<br> 
<br>

<table id="sig" width="480" cellspacing="0" cellpadding="0" border-spacing="0" style="width:480px;margin:0;padding:0;"><tbody><tr><td text-align="right" style="border-right:2px solid #4a4b4a;padding-right:10px;" valign="top">
<p style="padding: 0px; text-align: right;">
              <a href="http://www.flexvdi.com" title="flexVDI"><img src="https://www.flexvdi.com/signature/logo.flexvdi.png" moz-do-not-send="true" alt="flexVDI" border="0" height="45" width="151">
              </a>
          </p>
          <p style="padding: 5px 10px 0px 0px; font-size: 15px; font-weight: bold; color: rgb(62, 93, 107); line-height: 17px; height: 17px; text-align: right;">
            <span style="float:right">Javier Celaya Alastrué</span>
          </p>
           <p style="padding: 0px 10px 0px 0px; font-size: 13px; font-style: italic; color: rgb(0, 161, 193); line-height: 17px; height: 17px; text-align: right;">Chief Technology Officer</p>
      </td>
      <td style="padding-left:18px;display:block;">
        <p style="padding: 5px 0px 0px;">
           <img src="https://flexvdi.com/signature/mail.png" moz-do-not-send="true" style="margin:1px 7px 0 0;" alt="email" align="left" height="17" width="17">
        <a href="mailto:javier.celaya@flexvdi.com" style="font-size:14px;color:#727272;line-height:17px;height:17px;">javier.celaya@flexvdi.com</a>
        </p>
        <p style="padding: 5px 0px 0px;">
          <img src="https://flexvdi.com/signature/phone.png" moz-do-not-send="true" style="margin:0 7px 0 0;" alt="Phone" align="left" height="17" width="17">
        <span style="font-size:14px;color:#727272;line-height:17px;height:17px;">+34696969959</span> 
      </p>
        <p style="padding: 5px 0px 0px;"> <img src="https://flexvdi.com/signature/skype.png" moz-do-not-send="true" style="margin:0 7px 0 0;" alt="Skype" align="left" height="17" width="17"> 
        <span style="font-size:14px;color:#727272;line-height:17px;height:17px;">j_celaya</span>
        </p>
        <p style="padding: 5px 0px 0px;">
          <img src="https://flexvdi.com/signature/legal.png" moz-do-not-send="true" style="margin:0 7px 0 0;" alt="Legal" align="left" height="17" width="17">
        <a href="https://flexvdi.com/es/legal" style="font-size:14px;font-style:italic;color:#727272;line-height:17px;height:17px;">Legal Information and Privacy Policy</a>
          </p>
      </td>
    </tr>
    <tr>
        <td colspan="2" height="300">
            <p style="font-family:Helvetica,Arial;font-size:14px;font-style:italic;color:#313131;text-align: center; font-weight: bold">Política de confidencialidad</p>
            <p style="font-family:Helvetica,Arial;font-size:10px;font-style:italic;color:#313131;text-align: justify">Este mensaje y los ficheros anexos son confidenciales dirigiéndose exclusivamente al destinatario mencionado en el encabezamiento. Si usted ha recibido este correo por error, tenga la amabilidad de eliminarlo de su sistema y no divulgar el contenido a terceros. Los datos personales facilitados por usted o por terceros serán tratados por FLEXIBLE SOFTWARE SOLUTIONS S.L.U. con la finalidad de gestionar y mantener los contactos y relaciones que se produzcan como consecuencia de la relación que mantiene con FLEXIBLE SOFTWARE SOLUTIONS S.L.U. Normalmente, la base jurídica que legitima este tratamiento, será su consentimiento, el interés legítimo o la necesidad para gestionar una relación contractual o similar. El plazo de conservación de sus datos vendrá determinado por la relación que mantiene con nosotros. Para más información al respecto, o para ejercer sus derechos de acceso, rectificación, supresión, oposición, limitación o portabilidad, dirija una comunicación por escrito a FLEXIBLE SOFTWARE SOLUTIONS S.L.U: Avenida de Ranillas 1D, Planta 3, Oficina 3G, Zaragoza o al correo electrónico <a href="mailto:pdo@flexvdi.com" style="color:#313131">pdo@flexvdi.com</a>. En caso de considerar vulnerado su derecho a la protección de datos personales, podrá interponer una reclamación ante la Agencia Española de Protección de Datos (<a href="http://www.agpd.es" style="color:#313131">www.agpd.es</a>). </p>
        </td>
    </tr>
</tbody></table></span></div></body></html>