Commit 44827b6764da07e30eb6f7c97051d69956797fcb

Edward Thomson 2019-01-20T10:36:41

deprecation: add `used` attribute Recent GCC enables `-Wunused-const-variables`, which makes output quite noisy. Disable unused warnings for our deprecated variables.

1
2
3
4
5
6
7
8
9
10
11
12
diff --git a/include/git2/common.h b/include/git2/common.h
index 8d3d3c1..70c02a4 100644
--- a/include/git2/common.h
+++ b/include/git2/common.h
@@ -59,6 +59,7 @@ typedef size_t size_t;
 #if defined(__GNUC__)
 # define GIT_DEPRECATED(func) \
 			 __attribute__((deprecated)) \
+			 __attribute__((used)) \
 			 func
 #elif defined(_MSC_VER)
 # define GIT_DEPRECATED(func) __declspec(deprecated) func