diff options
author | Thomas Haller <thaller@redhat.com> | 2020-06-30 17:34:05 +0200 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2020-06-30 18:00:33 +0200 |
commit | 03dc75902662eecb3deee5a3dfc77e132def26cf (patch) | |
tree | 5c2deaebb3407908ce720c5da2fc4b079fe16b0d | |
parent | 3d542b55ed989d8a719c8896650b4263bca93d6b (diff) | |
download | NetworkManager-03dc75902662eecb3deee5a3dfc77e132def26cf.tar.gz |
modem: suppress deprecated warning from libmm for MM_MODEM_CAPABILITY_LTE_ADVANCED
On Ubuntu 20.10, we build against ModemManager 1.14.0 and get a compiler warning:
../src/devices/wwan/nm-modem-broadband.c: In function 'try_create_connect_properties':
../src/devices/wwan/nm-modem-broadband.c:492:2: error: 'MMModemCapabilityDeprecated' is deprecated [-Werror=deprecated-declarations]
492 | if (MODEM_CAPS_3GPP (ctx->caps)) {
| ^~
Suppress it.
An alternative would be to drop the flag entirely. It seems the flag
was never used (and never will be used). But if that's true, there is
little harm done checking it. If it's not true, we better keep checking
for older versions.
https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/commit/0cd76bf1c411707b6ba1c4222d791e2115ef6840
-rw-r--r-- | src/devices/wwan/nm-modem-broadband.c | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/src/devices/wwan/nm-modem-broadband.c b/src/devices/wwan/nm-modem-broadband.c index f172e57fef..0929adafc4 100644 --- a/src/devices/wwan/nm-modem-broadband.c +++ b/src/devices/wwan/nm-modem-broadband.c @@ -20,9 +20,22 @@ #define NM_MODEM_BROADBAND_MODEM "modem" -#define MODEM_CAPS_3GPP(caps) (caps & (MM_MODEM_CAPABILITY_GSM_UMTS | \ - MM_MODEM_CAPABILITY_LTE | \ - MM_MODEM_CAPABILITY_LTE_ADVANCED)) +static gboolean +MODEM_CAPS_3GPP (MMModemCapability caps) +{ + G_GNUC_BEGIN_IGNORE_DEPRECATIONS + /* MM_MODEM_CAPABILITY_LTE_ADVANCED is marked as deprecated since ModemManager 1.14.0. + * + * The flag probably was never used, it certainly isn't used since 1.14.0. + * + * Still, just to be sure, there is no harm in checking it here. Suppress the + * warning, it should have no bad effect. + */ + return NM_FLAGS_ANY (caps, ( MM_MODEM_CAPABILITY_GSM_UMTS + | MM_MODEM_CAPABILITY_LTE + | MM_MODEM_CAPABILITY_LTE_ADVANCED)); + G_GNUC_END_IGNORE_DEPRECATIONS +} #define MODEM_CAPS_3GPP2(caps) (caps & (MM_MODEM_CAPABILITY_CDMA_EVDO)) |