diff --git a/ctags-gcc11.patch b/ctags-gcc11.patch new file mode 100644 index 0000000..ea78b7c --- /dev/null +++ b/ctags-gcc11.patch @@ -0,0 +1,268 @@ +diff -u ctags-5.8.orig/c.c ctags-5.8/c.c +--- ctags-5.8.orig/c.c 2021-09-27 10:44:24.772898854 +0200 ++++ ctags-5.8/c.c 2021-09-27 10:58:15.168499970 +0200 +@@ -624,7 +624,7 @@ + return name; + } + +-static void __unused__ pt (tokenInfo *const token) ++static void __maybe_unused__ pt (tokenInfo *const token) + { + if (isType (token, TOKEN_NAME)) + printf ("type: %-12s: %-13s line: %lu\n", +@@ -639,7 +639,7 @@ + tokenString (token->type), token->lineNumber); + } + +-static void __unused__ ps (statementInfo *const st) ++static void __maybe_unused__ ps (statementInfo *const st) + { + unsigned int i; + printf ("scope: %s decl: %s gotName: %s gotParenName: %s isPointer: %s\n", +diff -u ctags-5.8.orig/eiffel.c ctags-5.8/eiffel.c +--- ctags-5.8.orig/eiffel.c 2021-09-27 10:44:24.732898295 +0200 ++++ ctags-5.8/eiffel.c 2021-09-27 10:58:15.168499970 +0200 +@@ -807,7 +807,7 @@ + + static boolean parseType (tokenInfo *const token); + +-static void parseGeneric (tokenInfo *const token, boolean declaration __unused__) ++static void parseGeneric (tokenInfo *const token, boolean declaration __maybe_unused__) + { + unsigned int depth = 0; + #ifdef TYPE_REFERENCE_TOOL +diff -u ctags-5.8.orig/general.h ctags-5.8/general.h +--- ctags-5.8.orig/general.h 2007-05-03 05:21:08.000000000 +0200 ++++ ctags-5.8/general.h 2021-09-27 10:57:03.851490665 +0200 +@@ -57,10 +57,10 @@ + * to prevent warnings about unused variables. + */ + #if (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7)) && !defined (__GNUG__) +-# define __unused__ __attribute__((unused)) ++# define __maybe_unused__ __attribute__((unused)) + # define __printf__(s,f) __attribute__((format (printf, s, f))) + #else +-# define __unused__ ++# define __maybe_unused__ + # define __printf__(s,f) + #endif + +Common subdirectories: ctags-5.8.orig/gnu_regex and ctags-5.8/gnu_regex +diff -u ctags-5.8.orig/lregex.c ctags-5.8/lregex.c +--- ctags-5.8.orig/lregex.c 2021-09-27 10:44:24.732898295 +0200 ++++ ctags-5.8/lregex.c 2021-09-27 10:58:15.176500083 +0200 +@@ -538,11 +538,11 @@ + #endif /* HAVE_REGEX */ + + extern void addTagRegex ( +- const langType language __unused__, +- const char* const regex __unused__, +- const char* const name __unused__, +- const char* const kinds __unused__, +- const char* const flags __unused__) ++ const langType language __maybe_unused__, ++ const char* const regex __maybe_unused__, ++ const char* const name __maybe_unused__, ++ const char* const kinds __maybe_unused__, ++ const char* const flags __maybe_unused__) + { + #ifdef HAVE_REGEX + Assert (regex != NULL); +@@ -564,10 +564,10 @@ + } + + extern void addCallbackRegex ( +- const langType language __unused__, +- const char* const regex __unused__, +- const char* const flags __unused__, +- const regexCallback callback __unused__) ++ const langType language __maybe_unused__, ++ const char* const regex __maybe_unused__, ++ const char* const flags __maybe_unused__, ++ const regexCallback callback __maybe_unused__) + { + #ifdef HAVE_REGEX + Assert (regex != NULL); +@@ -581,7 +581,7 @@ + } + + extern void addLanguageRegex ( +- const langType language __unused__, const char* const regex __unused__) ++ const langType language __maybe_unused__, const char* const regex __maybe_unused__) + { + #ifdef HAVE_REGEX + if (! regexBroken) +@@ -602,7 +602,7 @@ + */ + + extern boolean processRegexOption (const char *const option, +- const char *const parameter __unused__) ++ const char *const parameter __maybe_unused__) + { + boolean handled = FALSE; + const char* const dash = strchr (option, '-'); +@@ -624,7 +624,7 @@ + return handled; + } + +-extern void disableRegexKinds (const langType language __unused__) ++extern void disableRegexKinds (const langType language __maybe_unused__) + { + #ifdef HAVE_REGEX + if (language <= SetUpper && Sets [language].count > 0) +@@ -639,8 +639,8 @@ + } + + extern boolean enableRegexKind ( +- const langType language __unused__, +- const int kind __unused__, const boolean mode __unused__) ++ const langType language __maybe_unused__, ++ const int kind __maybe_unused__, const boolean mode __maybe_unused__) + { + boolean result = FALSE; + #ifdef HAVE_REGEX +@@ -660,7 +660,7 @@ + return result; + } + +-extern void printRegexKinds (const langType language __unused__, boolean indent __unused__) ++extern void printRegexKinds (const langType language __maybe_unused__, boolean indent __maybe_unused__) + { + #ifdef HAVE_REGEX + if (language <= SetUpper && Sets [language].count > 0) +diff -u ctags-5.8.orig/lua.c ctags-5.8/lua.c +--- ctags-5.8.orig/lua.c 2006-10-12 05:26:40.000000000 +0200 ++++ ctags-5.8/lua.c 2021-09-27 10:58:15.176500083 +0200 +@@ -37,7 +37,7 @@ + */ + + /* for debugging purposes */ +-static void __unused__ print_string (char *p, char *q) ++static void __maybe_unused__ print_string (char *p, char *q) + { + for ( ; p != q; p++) + fprintf (errout, "%c", *p); +diff -u ctags-5.8.orig/main.c ctags-5.8/main.c +--- ctags-5.8.orig/main.c 2021-09-27 10:44:24.784899021 +0200 ++++ ctags-5.8/main.c 2021-09-27 10:58:15.176500083 +0200 +@@ -511,7 +511,7 @@ + * Start up code + */ + +-extern int main (int __unused__ argc, char **argv) ++extern int main (int __maybe_unused__ argc, char **argv) + { + cookedArgs *args; + #ifdef VMS +diff -u ctags-5.8.orig/options.c ctags-5.8/options.c +--- ctags-5.8.orig/options.c 2021-09-27 10:44:24.784899021 +0200 ++++ ctags-5.8/options.c 2021-09-27 10:58:15.180500140 +0200 +@@ -731,7 +731,7 @@ + } + + static void processExcludeOption ( +- const char *const option __unused__, const char *const parameter) ++ const char *const option __maybe_unused__, const char *const parameter) + { + const char *const fileName = parameter + 1; + if (parameter [0] == '\0') +@@ -869,7 +869,7 @@ + } + + static void processFilterTerminatorOption ( +- const char *const option __unused__, const char *const parameter) ++ const char *const option __maybe_unused__, const char *const parameter) + { + freeString (&Option.filterTerminator); + Option.filterTerminator = stringCopy (parameter); +@@ -931,8 +931,8 @@ + } + + static void processHelpOption ( +- const char *const option __unused__, +- const char *const parameter __unused__) ++ const char *const option __maybe_unused__, ++ const char *const parameter __maybe_unused__) + { + printProgramIdentification (); + putchar ('\n'); +@@ -1140,8 +1140,8 @@ + } + + static void processLicenseOption ( +- const char *const option __unused__, +- const char *const parameter __unused__) ++ const char *const option __maybe_unused__, ++ const char *const parameter __maybe_unused__) + { + printProgramIdentification (); + puts (""); +@@ -1167,8 +1167,8 @@ + } + + static void processListMapsOption ( +- const char *const __unused__ option, +- const char *const __unused__ parameter) ++ const char *const __maybe_unused__ option, ++ const char *const __maybe_unused__ parameter) + { + if (parameter [0] == '\0' || strcasecmp (parameter, "all") == 0) + printLanguageMaps (LANG_AUTO); +@@ -1184,8 +1184,8 @@ + } + + static void processListLanguagesOption ( +- const char *const option __unused__, +- const char *const parameter __unused__) ++ const char *const option __maybe_unused__, ++ const char *const parameter __maybe_unused__) + { + printLanguageList (); + exit (0); +@@ -1359,8 +1359,8 @@ + } + + static void processVersionOption ( +- const char *const option __unused__, +- const char *const parameter __unused__) ++ const char *const option __maybe_unused__, ++ const char *const parameter __maybe_unused__) + { + printProgramIdentification (); + exit (0); +diff -u ctags-5.8.orig/parse.c ctags-5.8/parse.c +--- ctags-5.8.orig/parse.c 2007-07-31 07:35:33.000000000 +0200 ++++ ctags-5.8/parse.c 2021-09-27 10:58:15.180500140 +0200 +@@ -376,7 +376,7 @@ + */ + + extern void processLanguageDefineOption ( +- const char *const option, const char *const parameter __unused__) ++ const char *const option, const char *const parameter __maybe_unused__) + { + #ifdef HAVE_REGEX + if (parameter [0] == '\0') +diff -u ctags-5.8.orig/python.c ctags-5.8/python.c +--- ctags-5.8.orig/python.c 2021-09-27 10:44:24.736898351 +0200 ++++ ctags-5.8/python.c 2021-09-27 10:58:15.180500140 +0200 +@@ -135,7 +135,7 @@ + * extract all relevant information and create a tag. + */ + static void makeFunctionTag (vString *const function, +- vString *const parent, int is_class_parent, const char *arglist __unused__) ++ vString *const parent, int is_class_parent, const char *arglist __maybe_unused__) + { + tagEntryInfo tag; + initTagEntry (&tag, vStringValue (function)); +diff -u ctags-5.8.orig/routines.c ctags-5.8/routines.c +--- ctags-5.8.orig/routines.c 2007-06-07 06:35:21.000000000 +0200 ++++ ctags-5.8/routines.c 2021-09-27 10:58:15.184500196 +0200 +@@ -526,7 +526,7 @@ + + #if ! defined (HAVE_STAT_ST_INO) + +-static void canonicalizePath (char *const path __unused__) ++static void canonicalizePath (char *const path __maybe_unused__) + { + #if defined (MSDOS_STYLE_PATH) + char *p; diff --git a/ctags.changes b/ctags.changes index 19fcc0b..9103e2e 100644 --- a/ctags.changes +++ b/ctags.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Mon Sep 27 08:59:35 UTC 2021 - Michal Suchanek + +- Fix build with gcc 11 + + ctags-gcc11.patch + ------------------------------------------------------------------- Tue May 4 11:15:01 UTC 2021 - Stefan BrĂ¼ns diff --git a/ctags.spec b/ctags.spec index 9bea532..8876a0a 100644 --- a/ctags.spec +++ b/ctags.spec @@ -46,6 +46,7 @@ Patch16: 0016-CVE-2014-7204.patch Patch17: 0017-Go-language-support.patch Patch18: 0018-SUSE-man-page-changes.patch Patch19: 0019-Do-not-include-build-time-in-binary.patch +Patch20: ctags-gcc11.patch BuildRequires: update-alternatives Requires(pre): update-alternatives Requires(post): update-alternatives @@ -59,25 +60,7 @@ Emacs, and several other editors. %prep %setup -q -%patch1 -p1 -%patch2 -p1 -%patch3 -p1 -%patch4 -p1 -%patch5 -p1 -%patch6 -p1 -%patch7 -p1 -%patch8 -p1 -%patch9 -p1 -%patch10 -p1 -%patch11 -p1 -%patch12 -p1 -%patch13 -p1 -%patch14 -p1 -%patch15 -p1 -%patch16 -p1 -%patch17 -p1 -%patch18 -p1 -%patch19 -p1 +%autopatch -p1 %build %configure