[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH] freetalk: fix build on gcc-10 (-fno-common)
From: |
Sergei Trofimovich |
Subject: |
[PATCH] freetalk: fix build on gcc-10 (-fno-common) |
Date: |
Sat, 7 May 2022 10:42:50 +0100 |
gcc-10 changed the default from -fcommon to fno-common:
https://gcc.gnu.org/PR85678
As a result build fails as:
ld: more.o:src/./more.h:15: multiple definition of `cin';
primitives.o:src/./more.h:15: first defined here
ld: more.o:src/./more.h:14: multiple definition of `initial_settings';
primitives.o:src/./more.h:14: first defined here
The change moves variable definitions to .c files.
---
src/more.c | 3 +++
src/more.h | 4 ++--
2 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/src/more.c b/src/more.c
index 1e76450..d6ed7b0 100644
--- a/src/more.c
+++ b/src/more.c
@@ -33,6 +33,9 @@
#include "more.h"
+struct termios initial_settings;
+FILE *cin;
+
void
gotsig(int sig)
{
diff --git a/src/more.h b/src/more.h
index a0160a9..083e8f8 100644
--- a/src/more.h
+++ b/src/more.h
@@ -11,8 +11,8 @@
#include <sys/stat.h>
#include <string.h>
-struct termios initial_settings;
-FILE *cin;
+extern struct termios initial_settings;
+extern FILE *cin;
void gotsig(int sig);
void more(char* buffer);
--
2.36.0
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [PATCH] freetalk: fix build on gcc-10 (-fno-common),
Sergei Trofimovich <=