wdoekes / asterisk-chan-dongle

chan_dongle channel driver for Huawei UMTS cards, works with Asterisk 14+
Other
298 stars 104 forks source link

Warnings with gcc 10.1 #100

Closed frispete closed 2 years ago

frispete commented 4 years ago

First of all, thanks for this valuable addition to asterisk.

It works nice and largely reliable here (simply using it to route calls from/to my mobile to asterisk). Since it depends on sensible external parameters (dongle model, firmware release, usb hub with reliable power supply), this is a great achievement. The real pain point is, how the dongle manufacturer handles documentation and firmware releases...

Anyway, here's a full build with gcc 10.1, as being available for a openSUSE Tumbleweed build here.

Since such warnings may point to some hidden problems, and gcc 10 is known top be particularly thorough in this regard, it would be nice to address them some day:

[    5s] Executing(%build): /bin/sh -e /var/tmp/rpm-tmp.E7BN6Q
[    5s] + umask 022
[    5s] + cd /home/abuild/rpmbuild/BUILD
[    5s] + /usr/bin/rm -rf /home/abuild/rpmbuild/BUILDROOT/asterisk-chan-dongle-20200528T215710.328b2b7-0.x86_64
[    5s] ++ dirname /home/abuild/rpmbuild/BUILDROOT/asterisk-chan-dongle-20200528T215710.328b2b7-0.x86_64
[    5s] + /usr/bin/mkdir -p /home/abuild/rpmbuild/BUILDROOT
[    5s] + /usr/bin/mkdir /home/abuild/rpmbuild/BUILDROOT/asterisk-chan-dongle-20200528T215710.328b2b7-0.x86_64
[    5s] + cd chan_dongle-20200528T215710.328b2b7
[    5s] + ./bootstrap
[    5s] configure.ac:71: installing './compile'
[    5s] configure.ac:6: installing './config.guess'
[    5s] configure.ac:6: installing './config.sub'
[    5s] configure.ac:7: installing './install-sh'
[    5s] configure.ac:7: installing './missing'
[    5s] + CFLAGS='-O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -Werror=return-type -flto=auto -g'
[    5s] + export CFLAGS
[    5s] + CXXFLAGS='-O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -Werror=return-type -flto=auto -g'
[    5s] + export CXXFLAGS
[    5s] + FFLAGS='-O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -Werror=return-type -flto=auto -g '
[    5s] + export FFLAGS
[    5s] + FCFLAGS='-O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -Werror=return-type -flto=auto -g '
[    5s] + export FCFLAGS
[    5s] + LDFLAGS=-flto=auto
[    5s] + export LDFLAGS
[    5s] + ./configure --host=x86_64-suse-linux-gnu --build=x86_64-suse-linux-gnu --program-prefix= --disable-dependency-tracking --prefix=/usr --exec-prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin --sysconfdir=/etc --datadir=/usr/share --includedir=/usr/include --libdir=/usr/lib64 --libexecdir=/usr/lib --localstatedir=/var --sharedstatedir=/var/lib --mandir=/usr/share/man --infodir=/usr/share/info --disable-dependency-tracking --with-astversion=16.0
[    5s] checking build system type... x86_64-suse-linux-gnu
[    5s] checking host system type... x86_64-suse-linux-gnu
[    5s] checking target system type... x86_64-suse-linux-gnu
[    5s] checking for a BSD-compatible install... /usr/bin/install -c
[    5s] checking whether build environment is sane... yes
[    5s] checking for a thread-safe mkdir -p... /usr/bin/mkdir -p
[    5s] checking for gawk... gawk
[    5s] checking whether make sets $(MAKE)... yes
[    5s] checking whether make supports nested variables... yes
[    5s] checking for x86_64-suse-linux-gnu-gcc... no
[    5s] checking for x86_64-suse-linux-gnu-cl... no
[    5s] checking for x86_64-suse-linux-gnu-cc... no
[    5s] checking for gcc... gcc
[    6s] checking whether the C compiler works... yes
[    6s] checking for C compiler default output file name... a.out
[    6s] checking for suffix of executables... 
[    6s] checking whether we are cross compiling... no
[    6s] checking for suffix of object files... o
[    6s] checking whether we are using the GNU C compiler... yes
[    6s] checking whether gcc accepts -g... yes
[    6s] checking for gcc option to accept ISO C89... none needed
[    6s] checking whether gcc understands -c and -o together... yes
[    6s] checking whether make supports the include directive... yes (GNU style)
[    6s] checking dependency style of gcc... none
[    6s] checking how to run the C preprocessor... gcc -E
[    6s] checking for strip... strip
[    6s] checking for rm... rm
[    6s] checking for library containing iconv... none required
[    6s] checking for sqlite3_open in -lsqlite3... yes
[    6s] checking for grep that handles long lines and -e... /usr/bin/grep
[    6s] checking for egrep... /usr/bin/grep -E
[    6s] checking for ANSI C header files... yes
[    6s] checking for sys/types.h... yes
[    6s] checking for sys/stat.h... yes
[    6s] checking for stdlib.h... yes
[    6s] checking for string.h... yes
[    6s] checking for memory.h... yes
[    6s] checking for strings.h... yes
[    6s] checking for inttypes.h... yes
[    6s] checking for stdint.h... yes
[    6s] checking for unistd.h... yes
[    6s] checking fcntl.h usability... yes
[    6s] checking fcntl.h presence... yes
[    6s] checking for fcntl.h... yes
[    6s] checking for stdlib.h... (cached) yes
[    6s] checking for string.h... (cached) yes
[    7s] checking sys/time.h usability... yes
[    7s] checking sys/time.h presence... yes
[    7s] checking for sys/time.h... yes
[    7s] checking termios.h usability... yes
[    7s] checking termios.h presence... yes
[    7s] checking for termios.h... yes
[    7s] checking whether asterisk.h in ../include... no
[    7s] checking whether asterisk.h in /usr/include... yes
[    7s] checking asterisk.h usability... no
[    7s] checking asterisk.h presence... no
[    7s] checking for asterisk.h... no
[    7s] checking whether iconv.h in ../include... no
[    7s] checking whether iconv.h in /usr/include... yes
[    7s] checking iconv.h usability... yes
[    7s] checking iconv.h presence... yes
[    7s] checking for iconv.h... yes
[    7s] checking sqlite3.h usability... yes
[    7s] checking sqlite3.h presence... yes
[    7s] checking for sqlite3.h... yes
[    7s] checking for iconv use const inbuf... no
[    7s] checking for iconv_t in iconv.h... yes
[    7s] checking for AST_CONTROL_SRCCHANGE in asterisk/frame.h... yes
[    7s] checking for an ANSI C-conforming const... yes
[    7s] checking for inline... inline
[    7s] checking for size_t... yes
[    7s] checking for ssize_t... yes
[    7s] checking for uint64_t... yes
[    7s] checking whether CC supports -fvisibility=hidden... yes
[    7s] checking whether CC supports -fPIC... yes
[    7s] checking whether CC supports -Wall... yes
[    7s] checking whether CC supports -Wextra... yes
[    7s] checking whether CC supports -MD -MT conftest.o -MF /dev/null -MP... yes
[    7s] checking whether DESTDIR is /usr/lib/asterisk/modules... no
[    7s] checking whether DESTDIR is /usr/lib64/asterisk/modules... yes
[    7s] checking for working memcmp... yes
[    7s] checking for memchr... yes
[    7s] checking for memmove... yes
[    7s] checking for memset... yes
[    7s] checking for memmem... yes
[    7s] checking for strcasecmp... yes
[    8s] checking for strchr... yes
[    8s] checking for strncasecmp... yes
[    8s] checking for strtol... yes
[    8s] checking for realpath... yes
[    8s] checking that generated files are newer than configure... done
[    8s] configure: creating ./config.status
[    8s] config.status: creating stamp-h
[    8s] config.status: creating Makefile
[    8s] config.status: creating config.h
[    8s] config.status: executing depfiles commands
[    8s] + DESTDIR=/usr/lib64/asterisk/modules
[    8s] + make -j8
[    8s] Makefile:76: warning: ignoring prerequisites on suffix rule definition
[    8s] gcc -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -Werror=return-type -flto=auto -g -O6 -Wno-old-style-declaration -I. -std=gnu99 -DAST_MODULE_SELF_SYM=__internal_chan_dongle_self -D_GNU_SOURCE -I/usr/include -I/usr/include -DHAVE_CONFIG_H  -fvisibility=hidden -fPIC -Wall -Wextra -MD -MT app.o -MF .app.o.d -MP  -o app.o -c app.c
[    8s] gcc -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -Werror=return-type -flto=auto -g -O6 -Wno-old-style-declaration -I. -std=gnu99 -DAST_MODULE_SELF_SYM=__internal_chan_dongle_self -D_GNU_SOURCE -I/usr/include -I/usr/include -DHAVE_CONFIG_H  -fvisibility=hidden -fPIC -Wall -Wextra -MD -MT at_command.o -MF .at_command.o.d -MP  -o at_command.o -c at_command.c
[    8s] gcc -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -Werror=return-type -flto=auto -g -O6 -Wno-old-style-declaration -I. -std=gnu99 -DAST_MODULE_SELF_SYM=__internal_chan_dongle_self -D_GNU_SOURCE -I/usr/include -I/usr/include -DHAVE_CONFIG_H  -fvisibility=hidden -fPIC -Wall -Wextra -MD -MT at_parse.o -MF .at_parse.o.d -MP  -o at_parse.o -c at_parse.c
[    8s] gcc -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -Werror=return-type -flto=auto -g -O6 -Wno-old-style-declaration -I. -std=gnu99 -DAST_MODULE_SELF_SYM=__internal_chan_dongle_self -D_GNU_SOURCE -I/usr/include -I/usr/include -DHAVE_CONFIG_H  -fvisibility=hidden -fPIC -Wall -Wextra -MD -MT at_queue.o -MF .at_queue.o.d -MP  -o at_queue.o -c at_queue.c
[    8s] gcc -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -Werror=return-type -flto=auto -g -O6 -Wno-old-style-declaration -I. -std=gnu99 -DAST_MODULE_SELF_SYM=__internal_chan_dongle_self -D_GNU_SOURCE -I/usr/include -I/usr/include -DHAVE_CONFIG_H  -fvisibility=hidden -fPIC -Wall -Wextra -MD -MT at_read.o -MF .at_read.o.d -MP  -o at_read.o -c at_read.c
[    8s] gcc -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -Werror=return-type -flto=auto -g -O6 -Wno-old-style-declaration -I. -std=gnu99 -DAST_MODULE_SELF_SYM=__internal_chan_dongle_self -D_GNU_SOURCE -I/usr/include -I/usr/include -DHAVE_CONFIG_H  -fvisibility=hidden -fPIC -Wall -Wextra -MD -MT at_response.o -MF .at_response.o.d -MP  -o at_response.o -c at_response.c
[    8s] gcc -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -Werror=return-type -flto=auto -g -O6 -Wno-old-style-declaration -I. -std=gnu99 -DAST_MODULE_SELF_SYM=__internal_chan_dongle_self -D_GNU_SOURCE -I/usr/include -I/usr/include -DHAVE_CONFIG_H  -fvisibility=hidden -fPIC -Wall -Wextra -MD -MT chan_dongle.o -MF .chan_dongle.o.d -MP  -o chan_dongle.o -c chan_dongle.c
[    8s] gcc -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -Werror=return-type -flto=auto -g -O6 -Wno-old-style-declaration -I. -std=gnu99 -DAST_MODULE_SELF_SYM=__internal_chan_dongle_self -D_GNU_SOURCE -I/usr/include -I/usr/include -DHAVE_CONFIG_H  -fvisibility=hidden -fPIC -Wall -Wextra -MD -MT channel.o -MF .channel.o.d -MP  -o channel.o -c channel.c
[    8s] at_response.c: In function 'at_response_cmgr':
[    8s] at_response.c:1309:24: warning: passing argument 1 of 'at_parse_cmgr' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
[    8s]  1309 |    res = at_parse_cmgr(str, len, &tpdu_type, sca, sizeof(sca), oa, sizeof(oa), scts, &mr, &st, dt, msg, &msg_len, &udh);
[    8s]       |                        ^~~
[    8s] In file included from at_response.c:24:
[    8s] at_parse.h:20:37: note: expected 'char *' but argument is of type 'const char *'
[    8s]    20 | EXPORT_DECL int at_parse_cmgr(char *str, size_t len, int *tpdu_type, char *sca, size_t sca_len, char *oa, size_t oa_len, char *scts, int *mr, int *st, char *dt, char *msg, size_t *msg_len, pdu_udh_t *udh);
[    8s]       |                               ~~~~~~^~~
[    8s] at_response.c: In function 'at_response_cusd':
[    8s] at_response.c:1491:34: warning: pointer targets in passing argument 2 of 'unhex' differ in signedness [-Wpointer-sign]
[    8s]  1491 |   int cusd_nibbles = unhex(cusd, cusd);
[    8s]       |                                  ^~~~
[    8s]       |                                  |
[    8s]       |                                  char *
[    8s] In file included from at_parse.h:11,
[    8s]                  from at_response.c:24:
[    8s] char_conv.h:13:48: note: expected 'uint8_t *' {aka 'unsigned char *'} but argument is of type 'char *'
[    8s]    13 | EXPORT_DECL int unhex(const char *in, uint8_t *out);
[    8s]       |                                       ~~~~~~~~~^~~
[    8s] at_response.c:1499:11: warning: comparison of integer expressions of different signedness: 'ssize_t' {aka 'long int'} and 'long unsigned int' [-Wsign-compare]
[    8s]  1499 |   if (res > sizeof(cusd_utf8_str) - 1) {
[    8s]       |           ^
[    8s] at_response.c:1505:34: warning: pointer targets in passing argument 2 of 'unhex' differ in signedness [-Wpointer-sign]
[    8s]  1505 |   int cusd_nibbles = unhex(cusd, cusd);
[    8s]       |                                  ^~~~
[    8s]       |                                  |
[    8s]       |                                  char *
[    8s] In file included from at_parse.h:11,
[    8s]                  from at_response.c:24:
[    8s] char_conv.h:13:48: note: expected 'uint8_t *' {aka 'unsigned char *'} but argument is of type 'char *'
[    8s]    13 | EXPORT_DECL int unhex(const char *in, uint8_t *out);
[    8s]       |                                       ~~~~~~~~~^~~
[    8s] at_parse.c: In function 'at_parse_cmgr':
[    8s] at_parse.c:370:31: warning: pointer targets in passing argument 2 of 'unhex' differ in signedness [-Wpointer-sign]
[    8s]   370 |  int pdu_length = (unhex(str, str) + 1) / 2;
[    8s]       |                               ^~~
[    8s]       |                               |
[    8s]       |                               char *
[    8s] In file included from at_parse.h:11,
[    8s]                  from at_parse.c:19:
[    8s] char_conv.h:13:48: note: expected 'uint8_t *' {aka 'unsigned char *'} but argument is of type 'char *'
[    8s]    13 | EXPORT_DECL int unhex(const char *in, uint8_t *out);
[    8s]       |                                       ~~~~~~~~~^~~
[    8s] at_parse.c:376:26: warning: pointer targets in passing argument 1 of 'pdu_parse_sca' differ in signedness [-Wpointer-sign]
[    8s]   376 |  res = pdu_parse_sca(str + i, pdu_length - i, sca, sca_len);
[    8s]       |                      ~~~~^~~
[    8s]       |                          |
[    8s]       |                          char *
[    8s] In file included from at_parse.h:12,
[    8s]                  from at_parse.c:19:
[    8s] pdu.h:43:40: note: expected 'uint8_t *' {aka 'unsigned char *'} but argument is of type 'char *'
[    8s]    43 | EXPORT_DECL int pdu_parse_sca(uint8_t *pdu, size_t pdu_length, char *sca, size_t sca_len);
[    8s]       |                               ~~~~~~~~~^~~
[    8s] at_parse.c:382:18: warning: comparison of integer expressions of different signedness: 'size_t' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
[    8s]   382 |  if (tpdu_length > pdu_length - i) {
[    8s]       |                  ^
[    8s] at_parse.c:386:28: warning: pointer targets in passing argument 1 of 'tpdu_parse_type' differ in signedness [-Wpointer-sign]
[    8s]   386 |  res = tpdu_parse_type(str + i, pdu_length - i, tpdu_type);
[    8s]       |                        ~~~~^~~
[    8s]       |                            |
[    8s]       |                            char *
[    8s] In file included from at_parse.h:12,
[    8s]                  from at_parse.c:19:
[    8s] pdu.h:44:42: note: expected 'uint8_t *' {aka 'unsigned char *'} but argument is of type 'char *'
[    8s]    44 | EXPORT_DECL int tpdu_parse_type(uint8_t *pdu, size_t pdu_length, int *type);
[    8s]       |                                 ~~~~~~~~~^~~
[    8s] at_parse.c:394:38: warning: pointer targets in passing argument 1 of 'tpdu_parse_status_report' differ in signedness [-Wpointer-sign]
[    8s]   394 |   res = tpdu_parse_status_report(str + i, pdu_length - i, mr, oa, oa_len, scts, dt, st);
[    8s]       |                                  ~~~~^~~
[    8s]       |                                      |
[    8s]       |                                      char *
[    8s] In file included from at_parse.h:12,
[    8s]                  from at_parse.c:19:
[    8s] pdu.h:45:51: note: expected 'uint8_t *' {aka 'unsigned char *'} but argument is of type 'char *'
[    8s]    45 | EXPORT_DECL int tpdu_parse_status_report(uint8_t *pdu, size_t pdu_length, int *mr, char *ra, size_t ra_len, char *scts, char *dt, int *st);
[    8s]       |                                          ~~~~~~~~~^~~
[    8s] at_parse.c:401:32: warning: pointer targets in passing argument 1 of 'tpdu_parse_deliver' differ in signedness [-Wpointer-sign]
[    8s]   401 |   res = tpdu_parse_deliver(str + i, pdu_length - i, *tpdu_type, oa, oa_len, scts, msg16_tmp, udh);
[    8s]       |                            ~~~~^~~
[    8s]       |                                |
[    8s]       |                                char *
[    8s] In file included from at_parse.h:12,
[    8s]                  from at_parse.c:19:
[    8s] pdu.h:46:45: note: expected 'uint8_t *' {aka 'unsigned char *'} but argument is of type 'char *'
[    8s]    46 | EXPORT_DECL int tpdu_parse_deliver(uint8_t *pdu, size_t pdu_length, int tpdu_type, char *oa, size_t oa_len, char *scts, uint16_t *msg, pdu_udh_t *udh);
[    8s]       |                                    ~~~~~~~~~^~~
[    8s] at_parse.c:401:83: warning: pointer targets in passing argument 7 of 'tpdu_parse_deliver' differ in signedness [-Wpointer-sign]
[    8s]   401 |   res = tpdu_parse_deliver(str + i, pdu_length - i, *tpdu_type, oa, oa_len, scts, msg16_tmp, udh);
[    8s]       |                                                                                   ^~~~~~~~~
[    8s]       |                                                                                   |
[    8s]       |                                                                                   int16_t * {aka short int *}
[    8s] In file included from at_parse.h:12,
[    8s]                  from at_parse.c:19:
[    8s] pdu.h:46:131: note: expected 'uint16_t *' {aka 'short unsigned int *'} but argument is of type 'int16_t *' {aka 'short int *'}
[    8s]    46 | EXPORT_DECL int tpdu_parse_deliver(uint8_t *pdu, size_t pdu_length, int tpdu_type, char *oa, size_t oa_len, char *scts, uint16_t *msg, pdu_udh_t *udh);
[    8s]       |                                                                                                                         ~~~~~~~~~~^~~
[    8s] at_parse.c:406:22: warning: pointer targets in passing argument 1 of 'ucs2_to_utf8' differ in signedness [-Wpointer-sign]
[    8s]   406 |   res = ucs2_to_utf8(msg16_tmp, res, msg, res * 2 + 2);
[    8s]       |                      ^~~~~~~~~
[    8s]       |                      |
[    8s]       |                      int16_t * {aka short int *}
[    8s] In file included from at_parse.h:11,
[    8s]                  from at_parse.c:19:
[    8s] char_conv.h:12:50: note: expected 'const uint16_t *' {aka 'const short unsigned int *'} but argument is of type 'int16_t *' {aka 'short int *'}
[    8s]    12 | EXPORT_DECL ssize_t ucs2_to_utf8(const uint16_t *in, size_t in_length, char *out, size_t out_size);
[    8s]       |                                  ~~~~~~~~~~~~~~~~^~
[    8s] gcc -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -Werror=return-type -flto=auto -g -O6 -Wno-old-style-declaration -I. -std=gnu99 -DAST_MODULE_SELF_SYM=__internal_chan_dongle_self -D_GNU_SOURCE -I/usr/include -I/usr/include -DHAVE_CONFIG_H  -fvisibility=hidden -fPIC -Wall -Wextra -MD -MT char_conv.o -MF .char_conv.o.d -MP  -o char_conv.o -c char_conv.c
[    8s] at_command.c: In function 'at_enqueue_initialization':
[    8s] at_command.c:135:20: warning: unused variable 'cmd21' [-Wunused-variable]
[    8s]   135 |  static const char cmd21[] = "AT+CSCS=\"UCS2\"\r";
[    8s]       |                    ^~~~~
[    8s] at_command.c: In function 'at_enqueue_ussd':
[    8s] at_command.c:358:31: warning: pointer targets in passing argument 3 of 'gsm7_pack' differ in signedness [-Wpointer-sign]
[    8s]   358 |  res = gsm7_pack(code16, res, code_packed, sizeof(code_packed), 0);
[    8s]       |                               ^~~~~~~~~~~
[    8s]       |                               |
[    8s]       |                               uint8_t * {aka unsigned char *}
[    8s] In file included from at_command.c:26:
[    8s] char_conv.h:16:75: note: expected 'char *' but argument is of type 'uint8_t *' {aka 'unsigned char *'}
[    8s]    16 | EXPORT_DECL ssize_t gsm7_pack(const uint16_t *in, size_t in_length, char *out, size_t out_size, unsigned out_padding);
[    8s]       |                                                                     ~~~~~~^~~
[    8s] At top level:
[    8s] at_command.c:135:20: warning: 'cmd21' defined but not used [-Wunused-const-variable=]
[    8s]   135 |  static const char cmd21[] = "AT+CSCS=\"UCS2\"\r";
[    8s]       |                    ^~~~~
[    8s] gcc -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -Werror=return-type -flto=auto -g -O6 -Wno-old-style-declaration -I. -std=gnu99 -DAST_MODULE_SELF_SYM=__internal_chan_dongle_self -D_GNU_SOURCE -I/usr/include -I/usr/include -DHAVE_CONFIG_H  -fvisibility=hidden -fPIC -Wall -Wextra -MD -MT cli.o -MF .cli.o.d -MP  -o cli.o -c cli.c
[    8s] gcc -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -Werror=return-type -flto=auto -g -O6 -Wno-old-style-declaration -I. -std=gnu99 -DAST_MODULE_SELF_SYM=__internal_chan_dongle_self -D_GNU_SOURCE -I/usr/include -I/usr/include -DHAVE_CONFIG_H  -fvisibility=hidden -fPIC -Wall -Wextra -MD -MT helpers.o -MF .helpers.o.d -MP  -o helpers.o -c helpers.c
[    8s] gcc -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -Werror=return-type -flto=auto -g -O6 -Wno-old-style-declaration -I. -std=gnu99 -DAST_MODULE_SELF_SYM=__internal_chan_dongle_self -D_GNU_SOURCE -I/usr/include -I/usr/include -DHAVE_CONFIG_H  -fvisibility=hidden -fPIC -Wall -Wextra -MD -MT manager.o -MF .manager.o.d -MP  -o manager.o -c manager.c
[    8s] gcc -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -Werror=return-type -flto=auto -g -O6 -Wno-old-style-declaration -I. -std=gnu99 -DAST_MODULE_SELF_SYM=__internal_chan_dongle_self -D_GNU_SOURCE -I/usr/include -I/usr/include -DHAVE_CONFIG_H  -fvisibility=hidden -fPIC -Wall -Wextra -MD -MT memmem.o -MF .memmem.o.d -MP  -o memmem.o -c memmem.c
[    8s] gcc -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -Werror=return-type -flto=auto -g -O6 -Wno-old-style-declaration -I. -std=gnu99 -DAST_MODULE_SELF_SYM=__internal_chan_dongle_self -D_GNU_SOURCE -I/usr/include -I/usr/include -DHAVE_CONFIG_H  -fvisibility=hidden -fPIC -Wall -Wextra -MD -MT ringbuffer.o -MF .ringbuffer.o.d -MP  -o ringbuffer.o -c ringbuffer.c
[    8s] gcc -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -Werror=return-type -flto=auto -g -O6 -Wno-old-style-declaration -I. -std=gnu99 -DAST_MODULE_SELF_SYM=__internal_chan_dongle_self -D_GNU_SOURCE -I/usr/include -I/usr/include -DHAVE_CONFIG_H  -fvisibility=hidden -fPIC -Wall -Wextra -MD -MT cpvt.o -MF .cpvt.o.d -MP  -o cpvt.o -c cpvt.c
[    8s] cli.c: In function 'cli_cmd':
[    8s] cli.c:392:15: warning: unused variable 'msg' [-Wunused-variable]
[    8s]   392 |  const char * msg;
[    8s]       |               ^~~
[    8s] gcc -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -Werror=return-type -flto=auto -g -O6 -Wno-old-style-declaration -I. -std=gnu99 -DAST_MODULE_SELF_SYM=__internal_chan_dongle_self -D_GNU_SOURCE -I/usr/include -I/usr/include -DHAVE_CONFIG_H  -fvisibility=hidden -fPIC -Wall -Wextra -MD -MT dc_config.o -MF .dc_config.o.d -MP  -o dc_config.o -c dc_config.c
[    8s] gcc -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -Werror=return-type -flto=auto -g -O6 -Wno-old-style-declaration -I. -std=gnu99 -DAST_MODULE_SELF_SYM=__internal_chan_dongle_self -D_GNU_SOURCE -I/usr/include -I/usr/include -DHAVE_CONFIG_H  -fvisibility=hidden -fPIC -Wall -Wextra -MD -MT pdu.o -MF .pdu.o.d -MP  -o pdu.o -c pdu.c
[    8s] gcc -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -Werror=return-type -flto=auto -g -O6 -Wno-old-style-declaration -I. -std=gnu99 -DAST_MODULE_SELF_SYM=__internal_chan_dongle_self -D_GNU_SOURCE -I/usr/include -I/usr/include -DHAVE_CONFIG_H  -fvisibility=hidden -fPIC -Wall -Wextra -MD -MT mixbuffer.o -MF .mixbuffer.o.d -MP  -o mixbuffer.o -c mixbuffer.c
[    8s] gcc -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -Werror=return-type -flto=auto -g -O6 -Wno-old-style-declaration -I. -std=gnu99 -DAST_MODULE_SELF_SYM=__internal_chan_dongle_self -D_GNU_SOURCE -I/usr/include -I/usr/include -DHAVE_CONFIG_H  -fvisibility=hidden -fPIC -Wall -Wextra -MD -MT pdiscovery.o -MF .pdiscovery.o.d -MP  -o pdiscovery.o -c pdiscovery.c
[    8s] gcc -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -Werror=return-type -flto=auto -g -O6 -Wno-old-style-declaration -I. -std=gnu99 -DAST_MODULE_SELF_SYM=__internal_chan_dongle_self -D_GNU_SOURCE -I/usr/include -I/usr/include -DHAVE_CONFIG_H  -fvisibility=hidden -fPIC -Wall -Wextra -MD -MT error.o -MF .error.o.d -MP  -o error.o -c error.c
[    8s] gcc -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -Werror=return-type -flto=auto -g -O6 -Wno-old-style-declaration -I. -std=gnu99 -DAST_MODULE_SELF_SYM=__internal_chan_dongle_self -D_GNU_SOURCE -I/usr/include -I/usr/include -DHAVE_CONFIG_H  -fvisibility=hidden -fPIC -Wall -Wextra -MD -MT smsdb.o -MF .smsdb.o.d -MP  -o smsdb.o -c smsdb.c
[    8s] pdu.c: In function 'pdu_store_number':
[    8s] pdu.c:381:20: warning: comparison of integer expressions of different signedness: 'int' and 'unsigned int' [-Wsign-compare]
[    8s]   381 |  for (j = 0; j + 1 < length; j += 2) {
[    8s]       |                    ^
[    8s] pdu.c:390:8: warning: comparison of integer expressions of different signedness: 'int' and 'unsigned int' [-Wsign-compare]
[    8s]   390 |  if (j != length) {
[    8s]       |        ^~
[    8s] pdu.c: In function 'pdu_parse_number':
[    8s] pdu.c:417:32: warning: pointer targets in passing argument 1 of 'gsm7_unpack_decode' differ in signedness [-Wpointer-sign]
[    8s]   417 |   res = gsm7_unpack_decode(pdu + i, syms, number16tmp, num_len, 0, 0, 0);
[    8s]       |                            ~~~~^~~
[    8s]       |                                |
[    8s]       |                                uint8_t * {aka unsigned char *}
[    8s] In file included from pdu.h:9,
[    8s]                  from pdu.c:9:
[    8s] char_conv.h:17:52: note: expected 'const char *' but argument is of type 'uint8_t *' {aka 'unsigned char *'}
[    8s]    17 | EXPORT_DECL ssize_t gsm7_unpack_decode(const char *in, size_t in_length, uint16_t *out, size_t out_size, unsigned in_padding, uint8_t ls, uint8_t ss);
[    8s]       |                                        ~~~~~~~~~~~~^~
[    8s] pdu.c:426:21: warning: comparison of integer expressions of different signedness: 'int' and 'unsigned int' [-Wsign-compare]
[    8s]   426 |   for (int j = 0; j < syms / 2; ++j) {
[    8s]       |                     ^
[    8s] pdu.c: In function 'pdu_build':
[    8s] pdu.c:639:46: warning: pointer targets in passing argument 3 of 'gsm7_pack' differ in signedness [-Wpointer-sign]
[    8s]   639 |   len += (gsm7_pack(msg, msg_reallen, buffer + len, length - len - 1, msg_padding) + 1) / 2;
[    8s]       |                                       ~~~~~~~^~~~~
[    8s]       |                                              |
[    8s]       |                                              uint8_t * {aka unsigned char *}
[    8s] In file included from pdu.h:9,
[    8s]                  from pdu.c:9:
[    8s] char_conv.h:16:75: note: expected 'char *' but argument is of type 'uint8_t *' {aka 'unsigned char *'}
[    8s]    16 | EXPORT_DECL ssize_t gsm7_pack(const uint16_t *in, size_t in_length, char *out, size_t out_size, unsigned out_padding);
[    8s]       |                                                                     ~~~~~~^~~
[    8s] pdu.c: In function 'tpdu_parse_status_report':
[    8s] pdu.c:687:12: warning: comparison of integer expressions of different signedness: 'int' and 'size_t' {aka 'long unsigned int'} [-Wsign-compare]
[    8s]   687 |  if (i + 2 > pdu_length) {
[    8s]       |            ^
[    8s] pdu.c:700:17: warning: comparison of integer expressions of different signedness: 'int' and 'size_t' {aka 'long unsigned int'} [-Wsign-compare]
[    8s]   700 |  if (i + 14 + 1 > pdu_length) {
[    8s]       |                 ^
[    8s] pdu.c: In function 'tpdu_parse_deliver':
[    8s] pdu.c:713:12: warning: comparison of integer expressions of different signedness: 'int' and 'size_t' {aka 'long unsigned int'} [-Wsign-compare]
[    8s]   713 |  if (i + 1 > pdu_length) {
[    8s]       |            ^
[    8s] pdu.c:726:20: warning: comparison of integer expressions of different signedness: 'int' and 'size_t' {aka 'long unsigned int'} [-Wsign-compare]
[    8s]   726 |  if (i + 2 + 7 + 1 > pdu_length) {
[    8s]       |                    ^
[    8s] pdu.c:831:16: warning: comparison of integer expressions of different signedness: 'int' and 'size_t' {aka 'long unsigned int'} [-Wsign-compare]
[    8s]   831 |  if (udl_bytes != pdu_length - i) {
[    8s]       |                ^~
[    8s] pdu.c:837:13: warning: comparison of integer expressions of different signedness: 'int' and 'size_t' {aka 'long unsigned int'} [-Wsign-compare]
[    8s]   837 |   if (i + 1 > pdu_length) {
[    8s]       |             ^
[    8s] pdu.c:921:36: warning: pointer targets in passing argument 1 of 'gsm7_unpack_decode' differ in signedness [-Wpointer-sign]
[    8s]   921 |   out_len = gsm7_unpack_decode(pdu + i, udl_nibbles, msg, 1024 /* assume enough memory, as SMS messages are limited in size */, msg_padding, udh->ls, udh->ss);
[    8s]       |                                ~~~~^~~
[    8s]       |                                    |
[    8s]       |                                    uint8_t * {aka unsigned char *}
[    8s] In file included from pdu.h:9,
[    8s]                  from pdu.c:9:
[    8s] char_conv.h:17:52: note: expected 'const char *' but argument is of type 'uint8_t *' {aka 'unsigned char *'}
[    8s]    17 | EXPORT_DECL ssize_t gsm7_unpack_decode(const char *in, size_t in_length, uint16_t *out, size_t out_size, unsigned in_padding, uint8_t ls, uint8_t ss);
[    8s]       |                                        ~~~~~~~~~~~~^~
[    8s] smsdb.c:391:12: warning: 'smsdb_purge' defined but not used [-Wunused-function]
[    8s]   391 | static int smsdb_purge()
[    8s]       |            ^~~~~~~~~~~
[    8s] smsdb.c:293:12: warning: 'smsdb_rollback_transaction' defined but not used [-Wunused-function]
[    8s]   293 | static int smsdb_rollback_transaction(void)
[    8s]       |            ^~~~~~~~~~~~~~~~~~~~~~~~~~
[    8s] gcc -flto=auto   -shared -Xlinker -x -o chan_dongle.so app.o at_command.o at_parse.o at_queue.o at_read.o at_response.o chan_dongle.o channel.o char_conv.o cli.o helpers.o manager.o memmem.o ringbuffer.o cpvt.o dc_config.o pdu.o mixbuffer.o pdiscovery.o error.o smsdb.o -lsqlite3 
[   10s] + RPM_EC=0
[   10s] ++ jobs -p
[   10s] + exit 0
wdoekes commented 2 years ago

https://github.com/wdoekes/asterisk-chan-dongle/commit/222039f42ebd74f9eca0f905e37c4da223506771

Thanks for the report.