[Bug report] minicom fails to build when configured with --disable-socket

Ondřej Lysoněk olysonek at redhat.com
Mon Feb 3 15:17:19 GMT 2020


Hi,

I noticed that when I build minicom from the current master branch
(a6a507dcb8bd) configured with --disable-socket, it fails. This is
because Socket_type_no_socket, Socket_type_unix and Socket_type_tcp are
used in several places in main.c, but this usage is not guarded with
'#ifdef USE_SOCKET'.

Note that I don't have a use case for this; just reporting what I
noticed.

Relevant output from the build:
gcc -DHAVE_CONFIG_H -I. -I..  -I../lib -DCONFDIR=\"/usr/local/etc\" -DLOCALEDIR=\"/usr/local/share/locale\"   -g -O2 -W -Wall -Wextra -std=gnu99 -Wno-format-truncation -MT main.o -MD -MP -MF .deps/main.Tpo -c -o main.o main.c
main.c: In function ‘open_term’:
main.c:385:41: error: ‘Socket_type_no_socket’ undeclared (first use in this function)
  385 |   if (portfd < 0 && portfd_is_socket == Socket_type_no_socket) {
      |                                         ^~~~~~~~~~~~~~~~~~~~~
main.c:385:41: note: each undeclared identifier is reported only once for each function it appears in
main.c:265:7: warning: unused variable ‘pid’ [-Wunused-variable]
  265 |   int pid;
      |       ^~~
main.c:264:7: warning: unused variable ‘fd’ [-Wunused-variable]
  264 |   int fd, n = 0;
      |       ^~
main.c:263:5: warning: unused variable ‘buf’ [-Wunused-variable]
  263 |   } buf;
      |     ^~~
main.c:259:15: warning: unused variable ‘stt’ [-Wunused-variable]
  259 |   struct stat stt;
      |               ^~~
main.c: In function ‘show_status_fmt’:
main.c:600:39: error: ‘Socket_type_unix’ undeclared (first use in this function)
  600 |               if (portfd_is_socket == Socket_type_unix)
      |                                       ^~~~~~~~~~~~~~~~
main.c:602:37: error: ‘Socket_type_tcp’ undeclared (first use in this function)
  602 |        else if (portfd_is_socket == Socket_type_tcp)
      |                                     ^~~~~~~~~~~~~~~
At top level:
main.c:60:14: warning: ‘mdevlockname’ defined but not used [-Wunused-function]
   60 | static char *mdevlockname(char *s, char *res, int reslen)
      |              ^~~~~~~~~~~~
make[2]: *** [Makefile:541: main.o] Error 1


Best regards
Ondrej Lysonek




More information about the minicom-devel mailing list