From f2ef3291448403da85fbb0571da97acf5753c7aa Mon Sep 17 00:00:00 2001 From: Sergei Trofimovich Date: Fri, 24 Jan 2020 11:37:09 +0000 Subject: [PATCH] iozone: fix build failure against gcc-10 On gcc-10 (and gcc-9 -fno-common) build fails as: ``` x86_64-pc-linux-gnu-gcc iozone_linux-AMD64.o libbif.o libasync.o \ -lrt -lpthread -o iozone ld: libbif.o:(.bss+0x8): multiple definition of `junk'; iozone_linux-AMD64.o:(.bss+0xbd4e0): first defined here ``` gcc-10 will change the default from -fcommon to fno-common: https://gcc.gnu.org/PR85678. The error also happens if CFLAGS=-fno-common passed explicitly. Reported-by: David Seifert Bug: https://bugs.gentoo.org/706232 Signed-off-by: Sergei Trofimovich --- src/current/fileop.c | 2 +- src/current/iozone.c | 2 +- src/current/libbif.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/current/fileop.c b/src/current/fileop.c index 70010f4..a2650e1 100644 --- a/src/current/fileop.c +++ b/src/current/fileop.c @@ -74,7 +74,7 @@ extern char *opterr; int fsync(); int getopt(); #endif -int junk, *junkp; +static int junk, *junkp; int x,excel; int verbose = 0; int sz = 1; diff --git a/src/current/iozone.c b/src/current/iozone.c index 34ce32a..9afc4f4 100644 --- a/src/current/iozone.c +++ b/src/current/iozone.c @@ -1676,7 +1676,7 @@ int client_error; char pit_hostname[40]; char pit_service[8]; -int junk; +static int junk; /* * Host ports used to listen, and handle errors. diff --git a/src/current/libbif.c b/src/current/libbif.c index b2b9668..8e72e63 100644 --- a/src/current/libbif.c +++ b/src/current/libbif.c @@ -55,7 +55,7 @@ /* Middle Endian */ #define ENDIAN_4 4 -int junk, *junkp; +static int junk, *junkp; #ifdef HAVE_ANSIC_C -- 2.25.0