Skip to content
  • Thomas Haller's avatar
    libnm: avoid deprecated warning for NMVpnPluginInfo · e0bded93
    Thomas Haller authored
    When merely including "nm-vpn-plugin-info.h" (or "NetworkManager.h")
    gcc raises warnings like:
      "Not available before 1.2 [-Werror=deprecated-declarations]"
    
    The problem is that the NMVpnPluginInfo typedef itself is marked as
    deprecated but also used by other functions like nm_vpn_plugin_info_get_name().
    
        typedef struct {
            int field;
        } Foo G_UNAVAILABLE(1,2);
    
        G_UNAVAILABLE(1,2)
        void deprecated_function (Foo *foo);
    
        warning: ‘Foo’ is deprecated: Not available before 1.2 [-Wdeprecated-declarations]
    
    I think that when a function is itself deprecated, gcc should not warn about
    the use of a deprecated typedef.
    Gcc's documentation states: "Note that the warnings only occur for
    uses and then only if the type is being applied to an identifier
    that itself is not being declared as deprecated.".
    Apparently, this only works for structs, but not for typedef of structs.
    
    Anyway. Remove the deprecation from NMVpnPluginInfo to avoid the compiler
    warning.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=753098
    
    Fixes: d6226bd9
    e0bded93