From nobody Tue Jul 4 14:31:42 2023 X-Original-To: ports@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QwQGl3CCcz4lTW9 for ; Tue, 4 Jul 2023 14:31:59 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QwQGl2mGwz3QL9; Tue, 4 Jul 2023 14:31:59 +0000 (UTC) (envelope-from dim@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1688481119; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=TXl0zyoGU5iF/a4B+yV2LT4CzbCBnJQf4w4cl4AeHYs=; b=hGygyC/bV1nGMIWNFJe59/Lf5v4pKgP4OGDUZtcDZVX1PlBihYTZ37ZVx6Zagr9p79XEOX Q88y4QX1zrnI8LkwGpseaSDBtiD6SSqh75iH2PVrXbS99aGAHWIM6AbJbpvzTT/JtR6j9m 2PjMdTf0ks/s6J3gxhb7XWCYmXrLZUNLwnIF5qwA+Sz5HJnNL9B0kL3VAy8/7JvthkQ8cJ hViIQtbPmBrSH29tN+x1nKol6S/4gnpDErcyXplTEDXonn5qZr6rlSi4wQ17i1uQ4UzQ32 odCpWYvPbZdXZWna0QdzZrtYnbx6HA+A1dvXlWX9gKuzARUdNVX/zmUc9A8Pwg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1688481119; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=TXl0zyoGU5iF/a4B+yV2LT4CzbCBnJQf4w4cl4AeHYs=; b=kbQgYQitBeu16avDOuHWxUV94ZdKOvcWzuVuQNdVA01weFvE6AmcN3t/hvaq2+iWpYgDj/ UwgkagytI/JxP5wGwD1p3+dT3s1L8qMUZpxDDa0tq6RaQTGMi0aIYl5RprXe+5f8O9o+Kg piSJGZ9Kf7KJIVz+woZU3UM+QZ/ppM7Ogv2FWgX2nMop6qan47XKRKbGvugWWrzpI+y/YJ ivkleHwbhk4OUzEI4bNGoH6DlYlht7Ub/RIPblEY6IMYhfNSG21a16g4BThDXhFIYhJVRk F5aYawjwvbjcoI7lO2MaI+R7uEPt6FkrOFkCiEPIIdNEU7TqVqKV+h92+FxcvQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1688481119; a=rsa-sha256; cv=none; b=ADawXMpqcXl83Onbob1z+6WxAeX0ad8Kc+zgKHHe412ofHzqkaYYhRhNxu+nVNBJ6oM+Fd 9uKhCIrLx/y/QGmxbVZYUuIFYk717fkeqGeRckF025y8HxCperLtBD/Y0isZyYrL6geuez nTNLy/YGzOC7vUVS2bznWhIce7kwGrdK3kJM05988w+0CGdKNzQd3exGq8rGsYbKFuUfKO m5aA/U62dqMewf2aHAATJTJEOl898eBMZJKAkYIAu5hSPBPX7q3re7APKMg8Daz3umheDR QovnL/RpAzHGfvP0BBWIU052n5O5cKIUWFLe/50tNYsYLuPjB5uExn37j937LA== Received: from tensor.andric.com (tensor.andric.com [87.251.56.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "tensor.andric.com", Issuer "R3" (verified OK)) (Authenticated sender: dim) by smtp.freebsd.org (Postfix) with ESMTPSA id 4QwQGl0G6TzHVV; Tue, 4 Jul 2023 14:31:59 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from smtpclient.apple (longrow-wifi.home.andric.com [192.168.0.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id D33444F4E6; Tue, 4 Jul 2023 16:31:57 +0200 (CEST) Content-Type: multipart/signed; boundary="Apple-Mail=_50368B33-18CF-48C7-BF28-0EAD5DD5CE1B"; protocol="application/pgp-signature"; micalg=pgp-sha1 List-Id: Porting software to FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-ports List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-ports@freebsd.org X-BeenThere: freebsd-ports@freebsd.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.600.7\)) Subject: Re: glib2 deprecated declarations failing on clang16 From: Dimitry Andric In-Reply-To: Date: Tue, 4 Jul 2023 16:31:42 +0200 Cc: Danilo Egea Gondolfo , FreeBSD Ports Message-Id: <22F61A7B-3566-4761-8D7A-DC78B9CF20E6@FreeBSD.org> References: To: Nuno Teixeira X-Mailer: Apple Mail (2.3731.600.7) X-ThisMailContainsUnwantedMimeParts: N --Apple-Mail=_50368B33-18CF-48C7-BF28-0EAD5DD5CE1B Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 I got to exactly the same patches. This is due to how glib's gclosure.h header declares its callback function type as '(void)', even though in reality the number and type of the arguments varies: /** * GCallback: * * The type used for callback functions in structure definitions and = function * signatures. * * This doesn't mean that all callback functions must take no = parameters and * return void. The required signature of a callback function is = determined by = * the context = in which is used (e.g. the signal to which it is connected). * * Use G_CALLBACK() to cast the callback function to a #GCallback. */ typedef void (*GCallback) (void); It would have been better if glib had just used '(...)', but the solution they have chosen requires each callback function to be cast using the G_CALLBACK() macro. That basically shuts up any incompatible function pointer warnings, and disables any argument checks. -Dimitry > On 4 Jul 2023, at 16:21, Nuno Teixeira wrote: >=20 > Hello Danilo! >=20 > Yes, it builds ok. >=20 > I will do a run test tomorrow on bluefish. >=20 > Any hint on how to explain it in commit: >=20 > --- > --- 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 in '%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)); > --- >=20 > Thanks! >=20 > Danilo Egea Gondolfo escreveu no dia ter=C3=A7a, = 4/07/2023 =C3=A0(s) 15:00: > On 04/07/2023 14:56, Dimitry Andric wrote: >=20 > > On 4 Jul 2023, at 14:37, Nuno Teixeira 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 = from 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/pf46bd2c5842= 5_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 = types passing 'gboolean (GtkLabel *, gchar *, gpointer)' (aka 'int = (struct _GtkLabel *, char *, void *)') to parameter of type 'GCallback' = (aka 'void (*)(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 = cases > > 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/ty8hLjVU >=20 >=20 >=20 > -- > Nuno Teixeira > FreeBSD Committer (ports) --Apple-Mail=_50368B33-18CF-48C7-BF28-0EAD5DD5CE1B Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.2 iF0EARECAB0WIQR6tGLSzjX8bUI5T82wXqMKLiCWowUCZKQtTgAKCRCwXqMKLiCW o3iJAJ4j9vhxEQmMA3LZHrkkrM25tHSHngCg/u9uCH+qUtkYjXjjDEnTFWekUNA= =bLiO -----END PGP SIGNATURE----- --Apple-Mail=_50368B33-18CF-48C7-BF28-0EAD5DD5CE1B--