From 70c1442a956363175aaba237b0c8751553658627 Mon Sep 17 00:00:00 2001 From: kevans Date: Sun, 29 Mar 2020 19:16:14 +0000 Subject: [PATCH] locate: fix -fno-common build Just a single variable declaration to extern and define elsewhere here, myctype. -fno-common will become a default in GCC10/LLVM11. MFC after: 3 days --- usr.bin/locate/locate/locate.c | 1 + usr.bin/locate/locate/locate.h | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/usr.bin/locate/locate/locate.c b/usr.bin/locate/locate/locate.c index 31b75efd1b0..29c46b2b78c 100644 --- a/usr.bin/locate/locate/locate.c +++ b/usr.bin/locate/locate/locate.c @@ -116,6 +116,7 @@ int f_limit; /* limit number of output lines, 0 == infinite */ u_int counter; /* counter for matches [-c] */ char separator='\n'; /* line separator */ +u_char myctype[UCHAR_MAX + 1]; void usage(void); void statistic(FILE *, char *); diff --git a/usr.bin/locate/locate/locate.h b/usr.bin/locate/locate/locate.h index 7b4f672f7d8..5ef97d36688 100644 --- a/usr.bin/locate/locate/locate.h +++ b/usr.bin/locate/locate/locate.h @@ -65,7 +65,7 @@ define TOLOWER(ch) tolower(ch) #else -u_char myctype[UCHAR_MAX + 1]; +extern u_char myctype[UCHAR_MAX + 1]; #define TOLOWER(ch) (myctype[ch]) #endif -- 2.45.2