Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 4 Jul 2023 15:21:42 +0100
From:      Nuno Teixeira <eduardo@freebsd.org>
To:        Danilo Egea Gondolfo <danilo@freebsd.org>
Cc:        ports@freebsd.org
Subject:   Re: glib2 deprecated declarations failing on clang16
Message-ID:  <CAFDf7ULBM1pV_X6OeRKbEggfyGcd0j-LuF720usWtM8KaG%2BJFA@mail.gmail.com>
In-Reply-To: <ffcb1751-dc86-b241-d7aa-f54896851697@FreeBSD.org>
References:  <CAFDf7U%2B-M1D7xL_AkB-eY%2B0jq2JjjdhzoZUZtnmanVoa25vOtQ@mail.gmail.com> <BBD89BC1-8E9D-4E6D-887E-4A785F4A21D4@FreeBSD.org> <ffcb1751-dc86-b241-d7aa-f54896851697@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
--0000000000003b245805ffaa0108
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

Hello Danilo!

Yes, it builds ok.

I will do a run test tomorrow on bluefish.

Any hint on how to explain it in commit:

---
--- src/bftextview2_autocomp.c.orig     2023-07-04 14:09:37 UTC
+++ src/bftextview2_autocomp.c
@@ -429,7 +429,7 @@ acwin_create(BluefishTextView * btv)
        /*gtk_widget_set_size_request(acw->reflabel,150,-1); */
        gtk_widget_show_all(acw->scroll);
        gtk_widget_show(hbox);
-       g_signal_connect(acw->reflabel, "activate-link",
acw_label_active_link_lcb, acw);
+       g_signal_connect(acw->reflabel, "activate-link",
G_CALLBACK(acw_label_active_link_lcb), acw);
        /*gtk_widget_set_size_request(GTK_WIDGET(acw->tree),100,200); */
        /*gtk_widget_set_size_request(acw->win, 150, 200); */

/*g_signal_connect(G_OBJECT(acw->win),"key-release-event",G_CALLBACK(acwin_=
key_release_lcb),acw);
*/
---
and
---
--- src/external_commands.c.orig        2023-07-04 14:12:18 UTC
+++ src/external_commands.c
@@ -483,7 +483,7 @@ create_commandstring(Texternalp * ep, const gchar * fo

gtk_dialog_set_default_response(GTK_DIALOG(dialog),GTK_RESPONSE_ACCEPT);
                tmp =3D g_strdup_printf(_("Supply arguments to define %%a i=
n
'%s'"), formatstring);
                entry =3D dialog_entry_labeled(NULL, tmp,
gtk_dialog_get_content_area(GTK_DIALOG(dialog)), 6);
-               g_signal_connect(G_OBJECT(entry), "activate",
command_dialog_entry_activated_lcb, dialog);
+               g_signal_connect(G_OBJECT(entry), "activate",
G_CALLBACK(command_dialog_entry_activated_lcb), dialog);
                g_free(tmp);
                gtk_widget_show_all(dialog);
                result =3D gtk_dialog_run(GTK_DIALOG(dialog));
---

Thanks!

Danilo Egea Gondolfo <danilo@freebsd.org> escreveu no dia ter=C3=A7a, 4/07/=
2023
=C3=A0(s) 15:00:

> On 04/07/2023 14:56, Dimitry Andric wrote:
>
> > On 4 Jul 2023, at 14:37, Nuno Teixeira <eduardo@freebsd.org> wrote:
> >> I'm getting build errors from current with www/bluefish about
> deprecated glib2 declarations and causing build to fail with clang16:
> >> ---
> >> /usr/local/include/glib-2.0/glib/gmacros.h:1262:37: note: expanded fro=
m
> macro 'G_DEPRECATED'
> >> #define G_DEPRECATED __attribute__((__deprecated__))
> >>                                      ^
> >> mv -f .deps/bluefish.Tpo .deps/bluefish.Po
> >> bftextview2_langmgr.c:2665:2: warning: 'g_thread_create_full' is
> deprecated: Use 'g_thread_new' instead [-Wdeprecated-declarations]
> >>          g_thread_create_full(build_bflang2scan_thread, NULL, 0, FALSE=
,
> FALSE, G_THREAD_PRIORITY_LOW, &gerror);
> >> ---
> >>
> >> Any help is welcome on finding out its cause.
> >>
> >> a related issue: https://github.com/PCSX2/pcsx2/issues/3315
> >>
> >> Build log:
> https://pkg-status.freebsd.org/beefy17/data/main-i386-default/pf46bd2c584=
25_s0631830a7a/logs/bluefish-2.2.14.log
> > The actual error is an incompatible callback function signature:
> >
> > bftextview2_autocomp.c:432:2: error: incompatible function pointer type=
s
> passing 'gboolean (GtkLabel *, gchar *, gpointer)' (aka 'int (struct
> _GtkLabel *, char *, void *)') to parameter of type 'GCallback' (aka 'voi=
d
> (*)(void)') [-Wincompatible-function-pointer-types]
> > g_signal_connect(acw->reflabel, "activate-link",
> acw_label_active_link_lcb, acw);
> >
> ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=
~~~~~~~
> > /usr/local/include/glib-2.0/gobject/gsignal.h:515:59: note: expanded
> from macro 'g_signal_connect'
> > g_signal_connect_data ((instance), (detailed_signal), (c_handler),
> (data), NULL, (GConnectFlags) 0)
> > ^~~~~~~~~~~
> > /usr/local/include/glib-2.0/gobject/gsignal.h:411:25: note: passing
> argument to parameter 'c_handler' here
> > GCallback c_handler,
> > ^
> >
> > I have seen these more often with glib-based applications. In some case=
s
> > it is feasible to fix the callback function to have the correct
> > signature, in other cases you can slap a cast in place. Or, if the
> > affected code is vala-generated (also happens), the big hammer is to
> > suppress the warning(s).
> >
> > -Dimitry
> >
> Not a glib expert here, but you can try this https://pastebin.com/ty8hLjV=
U
>
>

--=20
Nuno Teixeira
FreeBSD Committer (ports)

--0000000000003b245805ffaa0108
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div>Hello Danilo!</div><div><br></div><div>Yes, it builds=
 ok.</div><div><br></div><div>I will do a run test tomorrow on bluefish.<br=
></div><div><br></div><div>Any hint on how to explain it in commit:</div><d=
iv><br></div><div>---</div><div>--- src/bftextview2_autocomp.c.orig =C2=A0 =
=C2=A0 2023-07-04 14:09:37 UTC<br>+++ src/bftextview2_autocomp.c<br>@@ -429=
,7 +429,7 @@ acwin_create(BluefishTextView * btv)<br>=C2=A0 =C2=A0 =C2=A0 =
=C2=A0 /*gtk_widget_set_size_request(acw-&gt;reflabel,150,-1); */<br>=C2=A0=
 =C2=A0 =C2=A0 =C2=A0 gtk_widget_show_all(acw-&gt;scroll);<br>=C2=A0 =C2=A0=
 =C2=A0 =C2=A0 gtk_widget_show(hbox);<br>- =C2=A0 =C2=A0 =C2=A0 g_signal_co=
nnect(acw-&gt;reflabel, &quot;activate-link&quot;, acw_label_active_link_lc=
b, acw);<br>+ =C2=A0 =C2=A0 =C2=A0 g_signal_connect(acw-&gt;reflabel, &quot=
;activate-link&quot;, G_CALLBACK(acw_label_active_link_lcb), acw);<br>=C2=
=A0 =C2=A0 =C2=A0 =C2=A0 /*gtk_widget_set_size_request(GTK_WIDGET(acw-&gt;t=
ree),100,200); */<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 /*gtk_widget_set_size_requ=
est(acw-&gt;win, 150, 200); */<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 /*g_signal_co=
nnect(G_OBJECT(acw-&gt;win),&quot;key-release-event&quot;,G_CALLBACK(acwin_=
key_release_lcb),acw); */</div><div>---</div><div>and</div><div>---</div><d=
iv>--- src/external_commands.c.orig =C2=A0 =C2=A0 =C2=A0 =C2=A02023-07-04 1=
4:12:18 UTC<br>+++ src/external_commands.c<br>@@ -483,7 +483,7 @@ create_co=
mmandstring(Texternalp * ep, const gchar * fo<br>=C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 gtk_dialog_set_default_response(GTK_DIALOG(=
dialog),GTK_RESPONSE_ACCEPT);<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 tmp =3D g_strdup_printf(_(&quot;Supply arguments to define %%=
a in &#39;%s&#39;&quot;), formatstring);<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 entry =3D dialog_entry_labeled(NULL, tmp, gtk_dial=
og_get_content_area(GTK_DIALOG(dialog)), 6);<br>- =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 g_signal_connect(G_OBJECT(entry), &quot;activate&q=
uot;, command_dialog_entry_activated_lcb, dialog);<br>+ =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 g_signal_connect(G_OBJECT(entry), &quot;act=
ivate&quot;, G_CALLBACK(command_dialog_entry_activated_lcb), dialog);<br>=
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 g_free(tmp);<br>=C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 gtk_widget_show_all(di=
alog);<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 result =
=3D gtk_dialog_run(GTK_DIALOG(dialog));</div><div>---</div><div><br></div><=
div>Thanks!<br></div></div><br><div class=3D"gmail_quote"><div dir=3D"ltr" =
class=3D"gmail_attr">Danilo Egea Gondolfo &lt;<a href=3D"mailto:danilo@free=
bsd.org">danilo@freebsd.org</a>&gt; escreveu no dia ter=C3=A7a, 4/07/2023 =
=C3=A0(s) 15:00:<br></div><blockquote class=3D"gmail_quote" style=3D"margin=
:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"=
>On 04/07/2023 14:56, Dimitry Andric wrote:<br>
<br>
&gt; On 4 Jul 2023, at 14:37, Nuno Teixeira &lt;<a href=3D"mailto:eduardo@f=
reebsd.org" target=3D"_blank">eduardo@freebsd.org</a>&gt; wrote:<br>
&gt;&gt; I&#39;m getting build errors from current with www/bluefish about =
deprecated glib2 declarations and causing build to fail with clang16:<br>
&gt;&gt; ---<br>
&gt;&gt; /usr/local/include/glib-2.0/glib/gmacros.h:1262:37: note: expanded=
 from macro &#39;G_DEPRECATED&#39;<br>
&gt;&gt; #define G_DEPRECATED __attribute__((__deprecated__))<br>
&gt;&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ^<br>
&gt;&gt; mv -f .deps/bluefish.Tpo .deps/bluefish.Po<br>
&gt;&gt; bftextview2_langmgr.c:2665:2: warning: &#39;g_thread_create_full&#=
39; is deprecated: Use &#39;g_thread_new&#39; instead [-Wdeprecated-declara=
tions]<br>
&gt;&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 g_thread_create_full(build_bflan=
g2scan_thread, NULL, 0, FALSE, FALSE, G_THREAD_PRIORITY_LOW, &amp;gerror);<=
br>
&gt;&gt; ---<br>
&gt;&gt;<br>
&gt;&gt; Any help is welcome on finding out its cause.<br>
&gt;&gt;<br>
&gt;&gt; a related issue: <a href=3D"https://github.com/PCSX2/pcsx2/issues/=
3315" rel=3D"noreferrer" target=3D"_blank">https://github.com/PCSX2/pcsx2/i=
ssues/3315</a><br>
&gt;&gt;<br>
&gt;&gt; Build log: <a href=3D"https://pkg-status.freebsd.org/beefy17/data/=
main-i386-default/pf46bd2c58425_s0631830a7a/logs/bluefish-2.2.14.log" rel=
=3D"noreferrer" target=3D"_blank">https://pkg-status.freebsd.org/beefy17/da=
ta/main-i386-default/pf46bd2c58425_s0631830a7a/logs/bluefish-2.2.14.log</a>=
<br>
&gt; The actual error is an incompatible callback function signature:<br>
&gt;<br>
&gt; bftextview2_autocomp.c:432:2: error: incompatible function pointer typ=
es passing &#39;gboolean (GtkLabel *, gchar *, gpointer)&#39; (aka &#39;int=
 (struct _GtkLabel *, char *, void *)&#39;) to parameter of type &#39;GCall=
back&#39; (aka &#39;void (*)(void)&#39;) [-Wincompatible-function-pointer-t=
ypes]<br>
&gt; g_signal_connect(acw-&gt;reflabel, &quot;activate-link&quot;, acw_labe=
l_active_link_lcb, acw);<br>
&gt; ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=
~~~~~~~~~~<br>
&gt; /usr/local/include/glib-2.0/gobject/gsignal.h:515:59: note: expanded f=
rom macro &#39;g_signal_connect&#39;<br>
&gt; g_signal_connect_data ((instance), (detailed_signal), (c_handler), (da=
ta), NULL, (GConnectFlags) 0)<br>
&gt; ^~~~~~~~~~~<br>
&gt; /usr/local/include/glib-2.0/gobject/gsignal.h:411:25: note: passing ar=
gument to parameter &#39;c_handler&#39; here<br>
&gt; GCallback c_handler,<br>
&gt; ^<br>
&gt;<br>
&gt; I have seen these more often with glib-based applications. In some cas=
es<br>
&gt; it is feasible to fix the callback function to have the correct<br>
&gt; signature, in other cases you can slap a cast in place. Or, if the<br>
&gt; affected code is vala-generated (also happens), the big hammer is to<b=
r>
&gt; suppress the warning(s).<br>
&gt;<br>
&gt; -Dimitry<br>
&gt;<br>
Not a glib expert here, but you can try this <a href=3D"https://pastebin.co=
m/ty8hLjVU" rel=3D"noreferrer" target=3D"_blank">https://pastebin.com/ty8hL=
jVU</a><br>
<br>
</blockquote></div><br clear=3D"all"><br><span class=3D"gmail_signature_pre=
fix">-- </span><br><div dir=3D"ltr" class=3D"gmail_signature"><div dir=3D"l=
tr"><span style=3D"color:rgb(102,102,102)">Nuno Teixeira<br>FreeBSD Committ=
er (ports)</span></div></div>

--0000000000003b245805ffaa0108--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAFDf7ULBM1pV_X6OeRKbEggfyGcd0j-LuF720usWtM8KaG%2BJFA>