Tue, 09 Jul 2024 02:03:20 -0500
Fix incompatible pointer types for GtkItemFactoryCallbacks on gcc-14
The GtkItemFactoryEntry struct callback is of type GtkItemFactoryCallbacks
(aka void (*)(void)) but is initialised with GtkItemFactoryCallback1 types
(aka void (*)(void *, guint, GtkWidget *)).
This is coherent with the gtk-2 documentation:
> gtk_item_factory_create_items(..., GtkItemFactoryEntry *entries,...)
> entries : an array of GtkItemFactoryEntrys whose callback members must by of
> type GtkItemFactoryCallback1
But, under gcc-14, the implicit cast from GtkItemFactoryCallback1 to
GtkItemFactoryCallback triggers an incompatible-pointer-types error (See [gcc-doc]).
An exemple of this error:
pidgin/gtkconv.c:3096:66: error: initialization of 'void (*)(void)' from incompatible pointer type 'void (*)(void *, guint, GtkWidget *)' {aka 'void (*)(void *, unsigned int, struct _GtkWidget *)'} [-Wincompatible-pointer-types]
3096 | { N_("/Conversation/New Instant _Message..."), "<CTL>M", menu_new_conv_cb,
| ^~~~~~~~~~~~~~~~
pidgin/gtkconv.c:3096:66: note: (near initialization for 'menu_items[1].callback')
To fix this, explicitely cast to GtkItemFactoryCallback where needed.
[0]: https://gcc.gnu.org/gcc-14/porting_to.html#incompatible-pointer-types
Testing Done:
Built with gcc-14, started and clicked on some affected menus
Reviewed at https://reviews.imfreedom.org/r/3282/
| 5480 | 1 | /** |
| 2 | * @file gtkrequest.h GTK+ Request API | |
|
16254
eeb2bba4dc94
Rename the Doxygen group from gtkui to pidgin.
Richard Laager <rlaager@pidgin.im>
parents:
15931
diff
changeset
|
3 | * @ingroup pidgin |
|
20147
66f05a854eee
applied changes from 8a731bbd0197fbcc91a705c2d8f528154216defa
Richard Laager <rlaager@pidgin.im>
parents:
19859
diff
changeset
|
4 | */ |
|
66f05a854eee
applied changes from 8a731bbd0197fbcc91a705c2d8f528154216defa
Richard Laager <rlaager@pidgin.im>
parents:
19859
diff
changeset
|
5 | |
|
66f05a854eee
applied changes from 8a731bbd0197fbcc91a705c2d8f528154216defa
Richard Laager <rlaager@pidgin.im>
parents:
19859
diff
changeset
|
6 | /* pidgin |
| 5480 | 7 | * |
| 15572 | 8 | * Pidgin is the legal property of its developers, whose names are too numerous |
| 8046 | 9 | * to list here. Please refer to the COPYRIGHT file distributed with this |
| 10 | * source distribution. | |
|
7035
76bca80cd91d
[gaim-migrate @ 7598]
Christian Hammond <chipx86@chipx86.com>
parents:
5480
diff
changeset
|
11 | * |
| 5480 | 12 | * This program is free software; you can redistribute it and/or modify |
| 13 | * it under the terms of the GNU General Public License as published by | |
| 14 | * the Free Software Foundation; either version 2 of the License, or | |
| 15 | * (at your option) any later version. | |
| 16 | * | |
| 17 | * This program is distributed in the hope that it will be useful, | |
| 18 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 20 | * GNU General Public License for more details. | |
| 21 | * | |
| 22 | * You should have received a copy of the GNU General Public License | |
| 23 | * along with this program; if not, write to the Free Software | |
|
19859
71d37b57eff2
The FSF changed its address a while ago; our files were out of date.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
16254
diff
changeset
|
24 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA |
| 5480 | 25 | */ |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
26 | #ifndef _PIDGINREQUEST_H_ |
|
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
27 | #define _PIDGINREQUEST_H_ |
| 5480 | 28 | |
| 29 | #include "request.h" | |
| 30 | ||
| 31 | /** | |
| 32 | * Returns the UI operations structure for GTK+ request functions. | |
| 33 | * | |
| 34 | * @return The GTK+ UI request operations structure. | |
| 35 | */ | |
| 15884 | 36 | PurpleRequestUiOps *pidgin_request_get_ui_ops(void); |
| 5480 | 37 | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
38 | #endif /* _PIDGINREQUEST_H_ */ |