[virt-tools-list] [PATCH virt-viewer] Disable deprecation warnings for gtk_window_fullscreen_on_monitor

Eduardo Lima (Etrunko) etrunko at redhat.com
Wed Feb 13 12:53:44 UTC 2019


On 2/13/19 7:28 AM, Daniel P. Berrangé wrote:
> On Tue, Feb 12, 2019 at 05:34:44PM -0200, Eduardo Lima (Etrunko) wrote:
>> On 2/12/19 12:36 PM, Daniel P. Berrangé wrote:
>>> We use GLIB_VERSION_MAX_ALLOWED to prevent use of functions from
>>> GTK >= 3.12. When we do conditional compilation based on a GTK
>>> version check, we must thus suppress the warning:
>>>
>>>   CC       libvirt_viewer_la-virt-viewer-window.lo
>>> ../../src/virt-viewer-window.c: In function 'virt_viewer_window_enter_fullscreen':
>>> ../../src/virt-viewer-window.c:608:9: error: 'gtk_window_fullscreen_on_monitor' is deprecated: Not available before 3.18 [-Werror=deprecated-declarations]
>>>          gtk_window_fullscreen_on_monitor(GTK_WINDOW(priv->window),
>>>          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>>> In file included from /usr/include/gtk-3.0/gtk/gtkdialog.h:32,
>>>                  from /usr/include/gtk-3.0/gtk/gtkaboutdialog.h:30,
>>>                  from /usr/include/gtk-3.0/gtk/gtk.h:31,
>>>                  from ../../src/virt-viewer-window.c:28:
>>> /usr/include/gtk-3.0/gtk/gtkwindow.h:391:10: note: declared here
>>>  void     gtk_window_fullscreen_on_monitor(GtkWindow *window,
>>>           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>>> cc1: all warnings being treated as errors
>>>
>>> Signed-off-by: Daniel P. Berrangé <berrange at redhat.com>
>>> ---
>>>
>>> Pushed as a build breaker fix
>>>
>>>  src/virt-viewer-window.c | 3 +++
>>>  1 file changed, 3 insertions(+)
>>>
>>> diff --git a/src/virt-viewer-window.c b/src/virt-viewer-window.c
>>> index a7b2deb..d3e0fcf 100644
>>> --- a/src/virt-viewer-window.c
>>> +++ b/src/virt-viewer-window.c
>>> @@ -605,8 +605,11 @@ virt_viewer_window_enter_fullscreen(VirtViewerWindow *self, gint monitor)
>>>          // just go fullscreen on the current monitor
>>>          gtk_window_fullscreen(GTK_WINDOW(priv->window));
>>>      } else {
>>> +#pragma GCC diagnostic push
>>> +#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
>>>          gtk_window_fullscreen_on_monitor(GTK_WINDOW(priv->window),
>>>                                           gdk_screen_get_default(), monitor);
>>> +#pragma GCC diagnostic pop
>>>      }
>>>  #else
>>>          gtk_window_fullscreen(GTK_WINDOW(priv->window));
>>>
>>
>> I think it ould better to use
>> G_P{BEGIN,END}_IGNORE_DEPRECATED_DECLARATIONS instead.
> 
> If those are available in our min glib version please send a patch.
> I already pushed my patch since it was a build breaker fix blocking
> me doing the release.

The correct define is G_GNUC_BEGIN_IGNORE_DEPRECATIONS, and it is
available since 2.32.


> 
> Regards,
> Daniel
> 


-- 
Eduardo de Barros Lima (Etrunko)
Software Engineer - RedHat
etrunko at redhat.com




More information about the virt-tools-list mailing list