GTK+ recent warning from glib-genmarshal

34 views
Skip to first unread message

Neil Hodgson

unread,
Oct 21, 2017, 1:26:55 AM10/21/17
to Scintilla mailing list
With GTK+ on Ubuntu 17.10, a new warning has appeared during compilation of Scintilla.

glib-genmarshal --header --prefix=scintilla_marshal scintilla-marshal.list > scintilla-marshal.h
INFO: Reading scintilla-marshal.list...
WARNING: The token "NONE" is deprecated; use "VOID" instead
WARNING: The token "NONE" is deprecated; use "VOID” instead

The glib-genmarshal command converts a function signature like
NONE:INT,OBJECT
into some marshalling code with a header and implementation. It allows connecting Scintilla to applications through glib/GTK+.

This is, according to the following blog link, an old deprecation and was uncovered due to a recent rewrite of glib-genmarshal.

https://www.bassi.io/articles/2017/10/13/glib-tools/

Its only a warning so doesn’t have to be fixed quickly. The blog mentions several fix options: changing NONE to VOID made it happy but it may be worthwhile for someone interested in GTK+ to check whether there is a better approach.

There are also some warnings about some bad syntax in the Ambiance theme for GTK+ 2.0 but that appears to be the system’s fault, not Scintilla/SciTE's.
https://bugs.launchpad.net/ubuntu/+source/ubuntu-themes/+bug/1723422

Neil

Matthew Brush

unread,
Oct 21, 2017, 11:13:11 AM10/21/17
to scintilla...@googlegroups.com
On 2017-10-20 10:26 PM, Neil Hodgson wrote:
> With GTK+ on Ubuntu 17.10, a new warning has appeared during compilation of Scintilla.
>
> glib-genmarshal --header --prefix=scintilla_marshal scintilla-marshal.list > scintilla-marshal.h
> INFO: Reading scintilla-marshal.list...
> WARNING: The token "NONE" is deprecated; use "VOID" instead
> WARNING: The token "NONE" is deprecated; use "VOID” instead
>
> The glib-genmarshal command converts a function signature like
> NONE:INT,OBJECT
> into some marshalling code with a header and implementation. It allows connecting Scintilla to applications through glib/GTK+.
>
> This is, according to the following blog link, an old deprecation and was uncovered due to a recent rewrite of glib-genmarshal.
>
> https://www.bassi.io/articles/2017/10/13/glib-tools/
>
> Its only a warning so doesn’t have to be fixed quickly. The blog mentions several fix options: changing NONE to VOID made it happy but it may be worthwhile for someone interested in GTK+ to check whether there is a better approach.
>

There's not really any need to use glib-genmarshal anymore as the
functions can be generated dynamically by GLib. This was discussed a bit
in this thread:

https://groups.google.com/forum/#!topic/scintilla-interest/k9XwXKmrxts

But it was not used since it required GLib 2.30+. I guess now that a C++
standard library that was finalized last month is required, GLib 2.30
from 6 years ago won't be a problem.

Regards,
Matthew Brush

Mike Lischke

unread,
Oct 21, 2017, 2:21:12 PM10/21/17
to scintilla...@googlegroups.com
Hi Neil,

>
> With GTK+ on Ubuntu 17.10, a new warning has appeared during compilation of Scintilla.


You should also compile scintilla on the upcoming Fedora 27 release, which also produces a number of new warnings:

PlatGTK.cxx: In member function 'void Scintilla::Window::SetPositionRelative(Scintilla::PRectangle, Scintilla::Window)':
PlatGTK.cxx:1056:37: warning: 'gint gdk_screen_width()' is deprecated [-Wdeprecated-declarations]
int screenWidth = gdk_screen_width(); ^ In file included from /usr/include/gtk-3.0/gdk/gdk.h:50:0, from PlatGTK.cxx:19: /usr/include/gtk-3.0/gdk/gdkmain.h:108:6: note: declared here gint gdk_screen_width (void) G_GNUC_CONST; ^~~~~~~~~~~~~~~~
PlatGTK.cxx:1057:39: warning: 'gint gdk_screen_height()' is deprecated [-Wdeprecated-declarations]
int screenHeight = gdk_screen_height(); ^ In file included from /usr/include/gtk-3.0/gdk/gdk.h:50:0, from PlatGTK.cxx:19: /usr/include/gtk-3.0/gdk/gdkmain.h:110:6: note: declared here gint gdk_screen_height (void) G_GNUC_CONST; ^~~~~~~~~~~~~~~~~ PlatGTK.cxx: In member function 'Scintilla::PRectangle Scintilla::Window::GetMonitorRect(Scintilla::Point)':
PlatGTK.cxx:1158:88: warning: 'gint gdk_screen_get_monitor_at_point(GdkScreen*, gint, gint)' is deprecated: Use 'gdk_display_get_monitor_at_point' instead [-Wdeprecated-declarations]
monitor_num = gdk_screen_get_monitor_at_point(screen, pt.x + x_offset, pt.y + y_offset); ^ In file included from /usr/include/gtk-3.0/gdk/gdkapplaunchcontext.h:31:0, from /usr/include/gtk-3.0/gdk/gdk.h:32, from PlatGTK.cxx:19: /usr/include/gtk-3.0/gdk/gdkscreen.h:87:15: note: declared here gint gdk_screen_get_monitor_at_point (GdkScreen *screen, ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
PlatGTK.cxx:1159:60: warning: 'void gdk_screen_get_monitor_geometry(GdkScreen*, gint, GdkRectangle*)' is deprecated: Use 'gdk_monitor_get_geometry' instead [-Wdeprecated-declarations]
gdk_screen_get_monitor_geometry(screen, monitor_num, &rect); ^ In file included from /usr/include/gtk-3.0/gdk/gdkapplaunchcontext.h:31:0, from /usr/include/gtk-3.0/gdk/gdk.h:32, from PlatGTK.cxx:19: /usr/include/gtk-3.0/gdk/gdkscreen.h:78:14: note: declared here void gdk_screen_get_monitor_geometry (GdkScreen *screen, ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PlatGTK.cxx: In member function 'void Scintilla::Menu::Show(Scintilla::Point, Scintilla::Window&)':
PlatGTK.cxx:1897:39: warning: 'gint gdk_screen_height()' is deprecated [-Wdeprecated-declarations]
int screenHeight = gdk_screen_height(); ^ In file included from /usr/include/gtk-3.0/gdk/gdk.h:50:0, from PlatGTK.cxx:19: /usr/include/gtk-3.0/gdk/gdkmain.h:110:6: note: declared here gint gdk_screen_height (void) G_GNUC_CONST; ^~~~~~~~~~~~~~~~~
PlatGTK.cxx:1898:37: warning: 'gint gdk_screen_width()' is deprecated [-Wdeprecated-declarations]
int screenWidth = gdk_screen_width(); ^ In file included from /usr/include/gtk-3.0/gdk/gdk.h:50:0, from PlatGTK.cxx:19: /usr/include/gtk-3.0/gdk/gdkmain.h:108:6: note: declared here gint gdk_screen_width (void) G_GNUC_CONST; ^~~~~~~~~~~~~~~~
PlatGTK.cxx:1915:31: warning: 'void gtk_menu_popup(GtkMenu*, GtkWidget*, GtkWidget*, GtkMenuPositionFunc, gpointer, guint, guint32)' is deprecated: Use '(gtk_menu_popup_at_widget, gtk_menu_popup_at_pointer, gtk_menu_popup_at_rect)' instead [-Wdeprecated-declarations]
gtk_get_current_event_time()); ^ In file included from /usr/include/gtk-3.0/gtk/gtklabel.h:34:0, from /usr/include/gtk-3.0/gtk/gtkaccellabel.h:35, from /usr/include/gtk-3.0/gtk/gtk.h:33, from PlatGTK.cxx:20: /usr/include/gtk-3.0/gtk/gtkmenu.h:138:9: note: declared here void gtk_menu_popup (GtkMenu *menu, ^~~~~~~~~~~~~~ At global scope:
cc1plus: warning: unrecognized command line option '-Wno-deprecated-register'

and more (like implicit fall-through warnings).

Mike
--
www.soft-gems.net

Neil Hodgson

unread,
Oct 21, 2017, 5:57:42 PM10/21/17
to Scintilla mailing list
Mike Lischke:

> You should also compile scintilla on the upcoming Fedora 27 release, which also produces a number of new warnings:
>
> PlatGTK.cxx: In member function 'void Scintilla::Window::SetPositionRelative(Scintilla::PRectangle, Scintilla::Window)':
> PlatGTK.cxx:1056:37: warning: 'gint gdk_screen_width()' is deprecated [-Wdeprecated-declarations]
> int screenWidth = gdk_screen_width(); ^ In file included from /usr/include/gtk-3.0/gdk/gdk.h:50:0, from PlatGTK.cxx:19: /usr/include/gtk-3.0/gdk/gdkmain.h:108:6: note: declared here gint gdk_screen_width (void) G_GNUC_CONST; ^~~~~~~~~~~~~~~~

That looks like old code: the last call to gdk_screen_width was removed 9 months ago with 3.7.3 and
https://sourceforge.net/p/scintilla/code/ci/4fcd47d43161cfe072cdb355a19b4deef7206322/
https://sourceforge.net/p/scintilla/code/ci/f47420bbbb8706446623dc9fd03c834ca2cef352/

Neil

Mike Lischke

unread,
Oct 22, 2017, 5:49:53 AM10/22/17
to scintilla...@googlegroups.com
>> PlatGTK.cxx: In member function 'void Scintilla::Window::SetPositionRelative(Scintilla::PRectangle, Scintilla::Window)':
>> PlatGTK.cxx:1056:37: warning: 'gint gdk_screen_width()' is deprecated [-Wdeprecated-declarations]
>> int screenWidth = gdk_screen_width(); ^ In file included from /usr/include/gtk-3.0/gdk/gdk.h:50:0, from PlatGTK.cxx:19: /usr/include/gtk-3.0/gdk/gdkmain.h:108:6: note: declared here gint gdk_screen_width (void) G_GNUC_CONST; ^~~~~~~~~~~~~~~~
>
> That looks like old code: the last call to gdk_screen_width was removed 9 months ago with 3.7.3 and
> https://sourceforge.net/p/scintilla/code/ci/4fcd47d43161cfe072cdb355a19b4deef7206322/
> https://sourceforge.net/p/scintilla/code/ci/f47420bbbb8706446623dc9fd03c834ca2cef352/


Ah, I should finally upgrade, but there's always to many things to do ...

Thanks,

Mike
--
www.soft-gems.net

Neil Hodgson

unread,
Nov 21, 2017, 12:20:59 AM11/21/17
to Scintilla mailing list
Me:
> With GTK+ on Ubuntu 17.10, a new warning has appeared during compilation of Scintilla.
>
> glib-genmarshal --header --prefix=scintilla_marshal scintilla-marshal.list > scintilla-marshal.h
> INFO: Reading scintilla-marshal.list...
> WARNING: The token "NONE" is deprecated; use "VOID" instead
> WARNING: The token "NONE" is deprecated; use "VOID” instead

Committed simple change from NONE → VOID.
https://sourceforge.net/p/scintilla/code/ci/8760026bba6ab6a5c6ee3d2d7bd7a291ecb74574/

Neil

Reply all
Reply to author
Forward
0 new messages