Blame SOURCES/0003-Drop-superfluous-global-variable-definitions.patch

826c59
From a4fc603b3641d2efe31479116eb7ba66932901c7 Mon Sep 17 00:00:00 2001
826c59
From: =?UTF-8?q?Ond=C5=99ej=20Lyson=C4=9Bk?= <olysonek@redhat.com>
826c59
Date: Mon, 3 Feb 2020 13:21:41 +0100
826c59
Subject: [PATCH 3/3] Drop superfluous global variable definitions
826c59
826c59
The only place where the EXTERN macro mechanism is used to define the
826c59
global variables 'portfd_is_socket', 'portfd_is_connected' and
826c59
'portfd_sock_addr' is minicom.c (by defining an empty EXTERN macro and
826c59
including the minicom.h header). The source file sysdep1_s.c already
826c59
defines these variables. The sysdep1_s.o object file is always linked
826c59
to minicom.o. Thus it is safe to drop the definitions from minicom.c
826c59
and only declare the variables in the minicom.h header.
826c59
826c59
This fixes linking with gcc 10 which uses -fno-common by default,
826c59
disallowing multiple global variable definitions.
826c59
---
826c59
 src/minicom.h | 6 +++---
826c59
 1 file changed, 3 insertions(+), 3 deletions(-)
826c59
826c59
diff --git a/src/minicom.h b/src/minicom.h
826c59
index 0f9693b..1e7cb8c 100644
826c59
--- a/src/minicom.h
826c59
+++ b/src/minicom.h
826c59
@@ -113,9 +113,9 @@ EXTERN char *dial_user;     /* Our username there */
826c59
 EXTERN char *dial_pass;     /* Our password */
826c59
 
826c59
 #ifdef USE_SOCKET
826c59
-EXTERN int portfd_is_socket;	/* File descriptor is a unix socket */
826c59
-EXTERN int portfd_is_connected;	/* 1 if the socket is connected */
826c59
-EXTERN struct sockaddr_un portfd_sock_addr;	/* the unix socket address */
826c59
+extern int portfd_is_socket;	/* File descriptor is a unix socket */
826c59
+extern int portfd_is_connected;	/* 1 if the socket is connected */
826c59
+extern struct sockaddr_un portfd_sock_addr;	/* the unix socket address */
826c59
 #define portfd_connected ((portfd_is_socket && !portfd_is_connected) \
826c59
                            ? -1 : portfd)
826c59
 #else
826c59
-- 
826c59
2.24.1
826c59