mm-iface-modem-location.c: In function ‘interface_disabling_step’:
mm-iface-modem-location.c:1389:18: error: this statement may fall through [-Werror=implicit-fallthrough=]
1389 | ctx->step++;
| ~~~~~~~~~^~
mm-iface-modem-location.c:1391:5: note: here
1391 | case DISABLING_STEP_DISABLE_GATHERING:
| ^~~~
...
mm-iface-modem-location.c: In function ‘update_location_source_status’:
mm-iface-modem-location.c:482:5: error: enumeration value ‘MM_MODEM_LOCATION_SOURCE_NONE’ not handled in switch [-Werror=switch-enum]
482 | switch (source) {
| ^~~~~~
mm-iface-modem-simple.c: In function ‘connection_step’:
mm-iface-modem-simple.c:539:18: error: this statement may fall through [-Werror=implicit-fallthrough=]
539 | ctx->step++;
| ~~~~~~~~~^~
...
mm-iface-modem-cdma.c: In function ‘registration_check_step’:
mm-iface-modem-cdma.c:846:18: error: this statement may fall through [-Werror=implicit-fallthrough=]
846 | ctx->step++;
| ~~~~~~~~~^~
mm-iface-modem-cdma.c:848:5: note: here
848 | case REGISTRATION_CHECK_STEP_SETUP_REGISTRATION_CHECKS:
| ^~~~
...
mm-iface-modem-3gpp-ussd.c: In function ‘interface_disabling_step’:
mm-iface-modem-3gpp-ussd.c:572:18: error: this statement may fall through [-Werror=implicit-fallthrough=]
572 | ctx->step++;
| ~~~~~~~~~^~
..
mm-iface-modem-3gpp.c: In function ‘interface_disabling_step’:
mm-iface-modem-3gpp.c:1797:18: error: this statement may fall through [-Werror=implicit-fallthrough=]
1797 | ctx->step++;
| ~~~~~~~~~^~
...
mm-iface-modem.c: In function ‘peridic_signal_check_step’:
mm-iface-modem.c:1311:26: error: this statement may fall through [-Werror=implicit-fallthrough=]
1311 | ctx->running_step++;
| ~~~~~~~~~~~~~~~~~^~
...
mm-base-sms.c: In function ‘mm_base_sms_new_from_properties’:
mm-base-sms.c:1831:51: error: declaration of ‘properties’ shadows a global declaration [-Werror=shadow]
1831 | MMSmsProperties *properties,
| ~~~~~~~~~~~~~~~~~^~~~~~~~~~
mm-base-sms.c:53:20: note: shadowed declaration is here
53 | static GParamSpec *properties[PROP_LAST];
| ^~~~~~~~~~
mm-base-sms.c: In function ‘generate_3gpp_submit_pdus’:
mm-base-sms.c:153:19: error: declaration of ‘i’ shadows a previous local [-Werror=shadow]
153 | guint i = 0;
| ^
mm-base-sms.c:102:11: note: shadowed declaration is here
102 | guint i;
| ^
mm-base-modem.c: In function ‘mm_base_modem_organize_ports’:
mm-base-modem.c:1088:9: error: enumeration value ‘MM_PORT_TYPE_UNKNOWN’ not handled in switch [-Werror=switch-enum]
1088 | switch (mm_port_get_port_type (candidate)) {
| ^~~~~~
mm-base-modem.c:1088:9: error: enumeration value ‘MM_PORT_TYPE_IGNORED’ not handled in switch [-Werror=switch-enum]
mm-bearer-list.c: In function ‘mm_bearer_list_find_by_properties’:
mm-bearer-list.c:151:56: error: declaration of ‘properties’ shadows a global declaration [-Werror=shadow]
151 | MMBearerProperties *properties)
| ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~
mm-bearer-list.c:42:20: note: shadowed declaration is here
42 | static GParamSpec *properties[PROP_LAST];
| ^~~~~~~~~~
mm-broadband-bearer.c: In function ‘cid_selection_3gpp_context_step’:
mm-broadband-bearer.c:871:18: warning: this statement may fall through [-Wimplicit-fallthrough=]
871 | ctx->step++;
| ~~~~~~~~~^~
mm-broadband-bearer.c:873:5: note: here
873 | case CID_SELECTION_3GPP_STEP_FORMAT:
| ^~~~
mm-broadband-bearer.c: In function ‘interface_initialization_step’:
mm-broadband-bearer.c:2127:18: warning: this statement may fall through [-Wimplicit-fallthrough=]
2127 | ctx->step++;
| ~~~~~~~~~^~
mm-broadband-bearer.c:2129:5: note: here
2129 | case INITIALIZATION_STEP_CDMA_RM_PROTOCOL:
| ^~~~
mm-broadband-bearer.c:2148:18: warning: this statement may fall through [-Wimplicit-fallthrough=]
2148 | ctx->step++;
| ~~~~~~~~~^~
mm-broadband-bearer.c: In function ‘mm_broadband_bearer_new’:
mm-broadband-bearer.c:2204:46: warning: declaration of ‘properties’ shadows a global declaration [-Wshadow]
2204 | MMBearerProperties *properties,
| ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~
mm-broadband-bearer.c:58:20: note: shadowed declaration is here
58 | static GParamSpec *properties[PROP_LAST];
| ^~~~~~~~~~
mm-base-sim.c:1590:18: warning: this statement may fall through [-Wimplicit-fallthrough=]
1590 | ctx->step++;
| ~~~~~~~~~^~
mm-base-sim.c:1592:5: note: here
1592 | case INITIALIZATION_STEP_SIM_IDENTIFIER:
| ^~~~
mm-base-sim.c:1606:18: warning: this statement may fall through [-Wimplicit-fallthrough=]
1606 | ctx->step++;
| ~~~~~~~~~^~
mm-base-sim.c:1608:5: note: here
1608 | case INITIALIZATION_STEP_IMSI:
| ^~~~
mm-base-sim.c:1622:18: warning: this statement may fall through [-Wimplicit-fallthrough=]
1622 | ctx->step++;
| ~~~~~~~~~^~
mm-base-sim.c:1624:5: note: here
1624 | case INITIALIZATION_STEP_OPERATOR_ID:
| ^~~~
mm-base-sim.c:1638:18: warning: this statement may fall through [-Wimplicit-fallthrough=]
1638 | ctx->step++;
| ~~~~~~~~~^~
mm-base-sim.c:1640:5: note: here
1640 | case INITIALIZATION_STEP_OPERATOR_NAME:
| ^~~~
mm-base-sim.c:1654:18: warning: this statement may fall through [-Wimplicit-fallthrough=]
1654 | ctx->step++;
| ~~~~~~~~~^~
mm-base-sim.c:1656:5: note: here
1656 | case INITIALIZATION_STEP_EMERGENCY_NUMBERS:
| ^~~~
mm-base-sim.c:1670:18: warning: this statement may fall through [-Wimplicit-fallthrough=]
1670 | ctx->step++;
| ~~~~~~~~~^~
mm-base-sim.c:1672:5: note: here
1672 | case INITIALIZATION_STEP_LAST:
| ^~~~
mm-log.c: In function ‘glib_to_syslog_priority’:
mm-log.c:99:5: warning: enumeration value ‘G_LOG_FLAG_RECURSION’ not handled in switch [-Wswitch-enum]
99 | switch (level) {
| ^~~~~~
mm-log.c:99:5: warning: enumeration value ‘G_LOG_FLAG_FATAL’ not handled in switch [-Wswitch-enum]
mm-log.c:99:5: warning: enumeration value ‘G_LOG_LEVEL_INFO’ not handled in switch [-Wswitch-enum]
mm-log.c:99:5: warning: enumeration value ‘G_LOG_LEVEL_MASK’ not handled in switch [-Wswitch-enum]
reset.c: In function ‘main’:
reset.c:238:17: warning: passing argument 1 of ‘putenv’ discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
238 | putenv ("QCDM_DEBUG=1");
| ^~~~~~~~~~~~~~
In file included from reset.c:22:
/usr/include/stdlib.h:647:26: note: expected ‘char *’ but argument is of type ‘const char *’
647 | extern int putenv (char *__string) __THROW __nonnull ((1));
| ~~~~~~^~~~~~~~
reset.c: In function ‘print_buf’:
reset.c:47:19: warning: comparison of integer expressions of different signedness: ‘int’ and ‘size_t’ {aka ‘long unsigned int’} [-Wsign-compare]
47 | for (i = 0; i < len; i++) {
| ^
reset.c: In function ‘qcdm_wait_reply’:
reset.c:168:20: warning: comparison of integer expressions of different signedness: ‘int’ and ‘long unsigned int’ [-Wsign-compare]
168 | } while (total < sizeof (readbuf));
| ^
ipv6pref.c: In function ‘main’:
ipv6pref.c:288:11: warning: passing argument 1 of ‘putenv’ discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
288 | putenv ("QCDM_DEBUG=1");
| ^~~~~~~~~~~~~~
ipv6pref.c: In function ‘print_buf’:
ipv6pref.c:46:16: warning: comparison of integer expressions of different signedness: ‘int’ and ‘size_t’ {aka ‘long unsigned int’} [-Wsign-compare]
46 | for (i = 0; i < len; i++) {
| ^
ipv6pref.c: In function ‘qcdm_wait_reply’:
ipv6pref.c:167:17: warning: comparison of integer expressions of different signedness: ‘int’ and ‘long unsigned int’ [-Wsign-compare]
167 | } while (total < sizeof (readbuf));
| ^
modepref.c: In function ‘main’:
modepref.c:539:11: warning: passing argument 1 of ‘putenv’ discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
539 | putenv ("QCDM_DEBUG=1");
| ^~~~~~~~~~~~~~
In file included from modepref.c:21:
/usr/include/stdlib.h:647:26: note: expected ‘char *’ but argument is of type ‘const char *’
647 | extern int putenv (char *__string) __THROW __nonnull ((1));
| ~~~~~~^~~~~~~~
modepref.c: In function ‘print_buf’:
modepref.c:46:16: warning: comparison of integer expressions of different signedness: ‘int’ and ‘size_t’ {aka ‘long unsigned int’} [-Wsign-compare]
46 | for (i = 0; i < len; i++) {
| ^
modepref.c: In function ‘qcdm_wait_reply’:
modepref.c:167:17: warning: comparison of integer expressions of different signedness: ‘int’ and ‘long unsigned int’ [-Wsign-compare]
167 | } while (total < sizeof (readbuf));
| ^
test-qcdm-com.c: In function ‘test_com_pilot_sets’:
test-qcdm-com.c:1085:59: warning: implicit conversion from ‘float’ to ‘double’ when passing argument to function [-Wdouble-promotion]
1085 | g_message (" EC/IO %d (%.1f dB)", ecio, db);
| ^~
/usr/include/glib-2.0/glib/gmessages.h:333:32: note: in definition of macro ‘g_message’
333 | __VA_ARGS__)
| ^~~~~~~~~~~
test-qcdm-com.c: In function ‘print_buf’:
test-qcdm-com.c:273:19: warning: comparison of integer expressions of different signedness: ‘int’ and ‘gsize’ {aka ‘long unsigned int’} [-Wsign-compare]
273 | for (i = 0; i < len; i++) {
| ^
test-qcdm-com.c: In function ‘wait_reply’:
test-qcdm-com.c:367:20: warning: comparison of integer expressions of different signedness: ‘int’ and ‘long unsigned int’ [-Wsign-compare]
367 | } while (total < sizeof (readbuf));
| ^
logs.c: In function ‘qcdm_log_item_evdo_pilot_sets_v2_get_pilot’:
logs.c:179:94: warning: implicit conversion from ‘float’ to ‘double’ to match other operand of binary expression [-Wdouble-promotion]
179 | *out_rssi_dbm = (int32_t) (-110.0 + ((float) MAX (le16toh (pilot->pilot_energy) - 50, 0) / 14.0));
|
commands.c: In function ‘qcdm_cmd_pilot_sets_result_get_pilot’:
commands.c:756:33: warning: implicit conversion from ‘float’ to ‘double’ to match other operand of binary expression [-Wdouble-promotion]
756 | *out_db = (float) set->ecio * -0.5;
| ^
mm-enums-types.c: In function ‘mm_modem_lock_get_string’:
mm-enums-types.c:165:17: warning: comparison of integer expressions of different signedness: ‘MMModemLock’ {aka ‘enum <anonymous>’} and ‘gint’ {aka ‘const int’} [-Wsign-compare]
165 | if (val == mm_modem_lock_values[i].value)
| ^~
The autoconf macros AX_COMPILER_FLAGS_{CFLAGS|GIR|LDFLAGS} test
for compiler and linker support of various flags, and add the flags to
the generated output.
If the command-line option '--enable-compile-warnings' is specified to
'configure', a number of additional warning options is also added to the
output. This is the default.
This update requires the presence of the GNU autoconf-archive in the
system.
The auth provider is now a singleton (since 20ab6550), one single
object that lives throughout the whole program execution, and so we
don't need to keep our own full references around. This fix makes
sure we don't attempt to unref a full auth provider reference we
don't own.
Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/issues/179
When a GSM-7 encoded string is packed, the process of packing the
septets into bytes may end up with one last byte holding the last bit
of the last septet. When this situation happens, the last byte will
end up with the 7 remaining bits set to 0.
When this packed string is unpacked, the logic to unpack will unpack
those last 7 bits as an additional septet, with the value 0x00.
The 0x00 value encoded in GSM-7 is the '@' character, EXCEPT when this
character is found at the end of the string, in which case the value
should be considered as NUL and trigger the end of string already.
So, fix the conversion logic between GSM-7 and UTF-8, so that whenever
we find the 0x00 character at the end of the string, we ignore it
instead of adding a bogus '@' trailing character.
This commit fixes the "/MM/charsets/gsm7/default-chars" unit test
after having it updated to perform the full conversion cycle:
UTF-8 -> packed GSM7 -> UTF-8
The auth provider setup is a bit over-engineered. Simplify it by
making a single MMAuthProvider object that may or may not use polkit,
depending on configure options. This object is also setup as a
singleton object using the helper MM_DEFINE_SINGLETON_GETTER().
The different types of ports available in the modem will require
different types of cleanup actions. E.g. QMI and MBIM ports need an
explicit device close, and some other port types may need other
cleanups.