[PATCH 2/3] Drop superfluous global variable definitions

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


The only place where the EXTERN macro mechanism is used to define the
global variables 'vt_outmap' and 'vt_inmap' is minicom.c (by defining
an empty EXTERN macro and including the minicom.h header). The file
vt100.c already defines these variables. The vt100.o object file is
always linked to minicom.o. Thus it is safe not to define the
variables in minicom.c and only declare them in the minicom.h header.

This fixes linking with gcc 10 which uses -fno-common by default,
disallowing multiple global variable definitions.
---
 src/minicom.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/minicom.h b/src/minicom.h
index ea32ea8..e3a68ba 100644
--- a/src/minicom.h
+++ b/src/minicom.h
@@ -154,7 +154,7 @@ EXTERN int sbcolor;     /* Status Bar Background Color */
 EXTERN int st_attr;	/* Status Bar attributes. */
 
 /* jl 04.09.97 conversion tables */
-EXTERN unsigned char vt_outmap[256], vt_inmap[256];
+extern unsigned char vt_outmap[256], vt_inmap[256];
 
 /* MARK updated 02/17/95 - history buffer */
 EXTERN int num_hist_lines;  /* History buffer size */
-- 
2.24.1




More information about the minicom-devel mailing list