summaryrefslogtreecommitdiffstats
path: root/patches/source/vim/ctags.use-conventional-unused-marker.patch
blob: ca450dfa0238d9c297b3fd39704fd032ab5fd2fe (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
From 9643017460c221fed5689bcc55a41230200c40cc Mon Sep 17 00:00:00 2001
From: Simon Chopin <simon.chopin@canonical.com>
Date: Fri, 13 Aug 2021 16:47:57 +0200
Subject: build fix: Use conventional compiler attribute shorthand

The `__unused` macro has been used on Linux systems for this exact
purpose for ages. On the other hand, using the non-standard __unused__
breaks the build when compiling against glibc 2.34, as they use this
identifier internally.

Last-Update: 2021-08-13

Patch-Name: use-conventional-unused-marker.patch
---
 c.c        |  4 ++--
 eiffel.c   |  2 +-
 general.h  |  6 ++++--
 lregex.c   | 30 +++++++++++++++---------------
 lua.c      |  2 +-
 main.c     |  2 +-
 options.c  | 24 ++++++++++++------------
 parse.c    |  2 +-
 python.c   |  2 +-
 routines.c |  2 +-
 10 files changed, 39 insertions(+), 37 deletions(-)

diff --git a/c.c b/c.c
index 0cf0a14..c5d496b 100644
--- a/c.c
+++ b/c.c
@@ -619,7 +619,7 @@ static const char *keywordString (const keywordId keyword)
 	return name;
 }
 
-static void __unused__ pt (tokenInfo *const token)
+static void __unused pt (tokenInfo *const token)
 {
 	if (isType (token, TOKEN_NAME))
 		printf ("type: %-12s: %-13s   line: %lu\n",
@@ -634,7 +634,7 @@ static void __unused__ pt (tokenInfo *const token)
 			tokenString (token->type), token->lineNumber);
 }
 
-static void __unused__ ps (statementInfo *const st)
+static void __unused ps (statementInfo *const st)
 {
 	unsigned int i;
 	printf ("scope: %s   decl: %s   gotName: %s   gotParenName: %s\n",
diff --git a/eiffel.c b/eiffel.c
index e2f5a5c..67bfaa1 100644
--- a/eiffel.c
+++ b/eiffel.c
@@ -807,7 +807,7 @@ static void findKeyword (tokenInfo *const token, const keywordId keyword)
 
 static boolean parseType (tokenInfo *const token);
 
-static void parseGeneric (tokenInfo *const token, boolean declaration __unused__)
+static void parseGeneric (tokenInfo *const token, boolean declaration __unused)
 {
 	unsigned int depth = 0;
 #ifdef TYPE_REFERENCE_TOOL
diff --git a/general.h b/general.h
index 2d1d629..049e215 100644
--- a/general.h
+++ b/general.h
@@ -57,10 +57,12 @@
  *  to prevent warnings about unused variables.
  */
 #if (__GNUC__ > 2  ||  (__GNUC__ == 2  &&  __GNUC_MINOR__ >= 7)) && !defined (__GNUG__)
-# define __unused__  __attribute__((unused))
+# ifndef __unused
+#  define __unused  __attribute__((unused))
+# endif
 # define __printf__(s,f)  __attribute__((format (printf, s, f)))
 #else
-# define __unused__
+# define __unused
 # define __printf__(s,f)
 #endif
 
diff --git a/lregex.c b/lregex.c
index 37d7ea0..964508b 100644
--- a/lregex.c
+++ b/lregex.c
@@ -538,11 +538,11 @@ extern void findRegexTags (void)
 #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 __unused,
+		const char* const regex __unused,
+		const char* const name __unused,
+		const char* const kinds __unused,
+		const char* const flags __unused)
 {
 #ifdef HAVE_REGEX
 	Assert (regex != NULL);
@@ -564,10 +564,10 @@ extern void addTagRegex (
 }
 
 extern void addCallbackRegex (
-		const langType language __unused__,
-		const char* const regex __unused__,
-		const char* const flags __unused__,
-		const regexCallback callback __unused__)
+		const langType language __unused,
+		const char* const regex __unused,
+		const char* const flags __unused,
+		const regexCallback callback __unused)
 {
 #ifdef HAVE_REGEX
 	Assert (regex != NULL);
@@ -581,7 +581,7 @@ extern void addCallbackRegex (
 }
 
 extern void addLanguageRegex (
-		const langType language __unused__, const char* const regex __unused__)
+		const langType language __unused, const char* const regex __unused)
 {
 #ifdef HAVE_REGEX
 	if (! regexBroken)
@@ -602,7 +602,7 @@ extern void addLanguageRegex (
 */
 
 extern boolean processRegexOption (const char *const option,
-								   const char *const parameter __unused__)
+								   const char *const parameter __unused)
 {
 	boolean handled = FALSE;
 	const char* const dash = strchr (option, '-');
@@ -624,7 +624,7 @@ extern boolean processRegexOption (const char *const option,
 	return handled;
 }
 
-extern void disableRegexKinds (const langType language __unused__)
+extern void disableRegexKinds (const langType language __unused)
 {
 #ifdef HAVE_REGEX
 	if (language <= SetUpper  &&  Sets [language].count > 0)
@@ -639,8 +639,8 @@ extern void disableRegexKinds (const langType language __unused__)
 }
 
 extern boolean enableRegexKind (
-		const langType language __unused__,
-		const int kind __unused__, const boolean mode __unused__)
+		const langType language __unused,
+		const int kind __unused, const boolean mode __unused)
 {
 	boolean result = FALSE;
 #ifdef HAVE_REGEX
@@ -660,7 +660,7 @@ extern boolean enableRegexKind (
 	return result;
 }
 
-extern void printRegexKinds (const langType language __unused__, boolean indent __unused__)
+extern void printRegexKinds (const langType language __unused, boolean indent __unused)
 {
 #ifdef HAVE_REGEX
 	if (language <= SetUpper  &&  Sets [language].count > 0)
diff --git a/lua.c b/lua.c
index d385544..a2699c6 100644
--- a/lua.c
+++ b/lua.c
@@ -37,7 +37,7 @@ static kindOption LuaKinds [] = {
 */
 
 /* for debugging purposes */
-static void __unused__ print_string (char *p, char *q)
+static void __unused print_string (char *p, char *q)
 {
 	for ( ; p != q; p++)
 		fprintf (errout, "%c", *p);
diff --git a/main.c b/main.c
index 79948fe..38ce218 100644
--- a/main.c
+++ b/main.c
@@ -522,7 +522,7 @@ static void makeTags (cookedArgs *args)
  *		Start up code
  */
 
-extern int main (int __unused__ argc, char **argv)
+extern int main (int __unused argc, char **argv)
 {
 	cookedArgs *args;
 #ifdef VMS
diff --git a/options.c b/options.c
index ae773ef..029767c 100644
--- a/options.c
+++ b/options.c
@@ -730,7 +730,7 @@ static void processEtagsInclude (
 }
 
 static void processExcludeOption (
-		const char *const option __unused__, const char *const parameter)
+		const char *const option __unused, const char *const parameter)
 {
 	const char *const fileName = parameter + 1;
 	if (parameter [0] == '\0')
@@ -867,7 +867,7 @@ static void processFieldsOption (
 }
 
 static void processFilterTerminatorOption (
-		const char *const option __unused__, const char *const parameter)
+		const char *const option __unused, const char *const parameter)
 {
 	freeString (&Option.filterTerminator);
 	Option.filterTerminator = stringCopy (parameter);
@@ -929,8 +929,8 @@ static void printProgramIdentification (void)
 }
 
 static void processHelpOption (
-		const char *const option __unused__,
-		const char *const parameter __unused__)
+		const char *const option __unused,
+		const char *const parameter __unused)
 {
 	printProgramIdentification ();
 	putchar ('\n');
@@ -1138,8 +1138,8 @@ static void processLanguagesOption (
 }
 
 static void processLicenseOption (
-		const char *const option __unused__,
-		const char *const parameter __unused__)
+		const char *const option __unused,
+		const char *const parameter __unused)
 {
 	printProgramIdentification ();
 	puts ("");
@@ -1165,8 +1165,8 @@ static void processListKindsOption (
 }
 
 static void processListMapsOption (
-		const char *const __unused__ option,
-		const char *const __unused__ parameter)
+		const char *const __unused option,
+		const char *const __unused parameter)
 {
 	if (parameter [0] == '\0' || strcasecmp (parameter, "all") == 0)
 	    printLanguageMaps (LANG_AUTO);
@@ -1182,8 +1182,8 @@ static void processListMapsOption (
 }
 
 static void processListLanguagesOption (
-		const char *const option __unused__,
-		const char *const parameter __unused__)
+		const char *const option __unused,
+		const char *const parameter __unused)
 {
 	printLanguageList ();
 	exit (0);
@@ -1357,8 +1357,8 @@ static void processIgnoreOption (const char *const list)
 }
 
 static void processVersionOption (
-		const char *const option __unused__,
-		const char *const parameter __unused__)
+		const char *const option __unused,
+		const char *const parameter __unused)
 {
 	printProgramIdentification ();
 	exit (0);
diff --git a/parse.c b/parse.c
index 0b5e2c3..7e7361b 100644
--- a/parse.c
+++ b/parse.c
@@ -376,7 +376,7 @@ extern void freeParserResources (void)
 */
 
 extern void processLanguageDefineOption (
-		const char *const option, const char *const parameter __unused__)
+		const char *const option, const char *const parameter __unused)
 {
 #ifdef HAVE_REGEX
 	if (parameter [0] == '\0')
diff --git a/python.c b/python.c
index bf797de..f94e5de 100644
--- a/python.c
+++ b/python.c
@@ -135,7 +135,7 @@ static boolean isIdentifierCharacter (int c)
  * 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 __unused)
 {
 	tagEntryInfo tag;
 	initTagEntry (&tag, vStringValue (function));
diff --git a/routines.c b/routines.c
index 8ebe2e0..c465626 100644
--- a/routines.c
+++ b/routines.c
@@ -526,7 +526,7 @@ static boolean isPathSeparator (const int c)
 
 #if ! defined (HAVE_STAT_ST_INO)
 
-static void canonicalizePath (char *const path __unused__)
+static void canonicalizePath (char *const path __unused)
 {
 #if defined (MSDOS_STYLE_PATH)
 	char *p;