Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2022-09-14 22:56:39 +0300
committerJunio C Hamano <gitster@pobox.com>2022-09-14 22:56:39 +0300
commitdd407f1c7c7cce148d7313537494d0bc049ccb0e (patch)
tree960438c348acf300fca1f9e795b647df2d6f8e18 /git-compat-util.h
parenta6b42ec0c6e2ef492b0ed6d1f1123dc7e724154e (diff)
parent9ff7eb8c8882c477919acfe28a3d68bb58adf2ea (diff)
Merge branch 'ab/unused-annotation'
Undoes 'jk/unused-annotation' topic and redoes it to work around Coccinelle rules misfiring false positives in unrelated codepaths. * ab/unused-annotation: git-compat-util.h: use "deprecated" for UNUSED variables git-compat-util.h: use "UNUSED", not "UNUSED(var)"
Diffstat (limited to 'git-compat-util.h')
-rw-r--r--git-compat-util.h13
1 files changed, 7 insertions, 6 deletions
diff --git a/git-compat-util.h b/git-compat-util.h
index bfa5b619c1..b90b64718e 100644
--- a/git-compat-util.h
+++ b/git-compat-util.h
@@ -190,9 +190,10 @@ struct strbuf;
#define _SGI_SOURCE 1
#if defined(__GNUC__)
-#define UNUSED(var) UNUSED_##var __attribute__((unused))
+#define UNUSED __attribute__((unused)) \
+ __attribute__((deprecated ("parameter declared as UNUSED")))
#else
-#define UNUSED(var) UNUSED_##var
+#define UNUSED
#endif
#if defined(WIN32) && !defined(__CYGWIN__) /* Both MinGW and MSVC */
@@ -404,9 +405,9 @@ typedef uintmax_t timestamp_t;
#endif
#ifndef platform_core_config
-static inline int noop_core_config(const char *UNUSED(var),
- const char *UNUSED(value),
- void *UNUSED(cb))
+static inline int noop_core_config(const char *var UNUSED,
+ const char *value UNUSED,
+ void *cb UNUSED)
{
return 0;
}
@@ -500,7 +501,7 @@ static inline void extract_id_from_env(const char *env, uid_t *id)
}
static inline int is_path_owned_by_current_uid(const char *path,
- struct strbuf *UNUSED(report))
+ struct strbuf *report UNUSED)
{
struct stat st;
uid_t euid;