aboutsummaryrefslogtreecommitdiffstats
path: root/git-compat-util.h
diff options
context:
space:
mode:
Diffstat (limited to 'git-compat-util.h')
-rw-r--r--git-compat-util.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/git-compat-util.h b/git-compat-util.h
index a06d4f3809..e283c46c6f 100644
--- a/git-compat-util.h
+++ b/git-compat-util.h
@@ -44,6 +44,16 @@ struct strbuf;
#define GIT_GNUC_PREREQ(maj, min) 0
#endif
+#if defined(__GNUC__) || defined(__clang__)
+# define PRAGMA(pragma) _Pragma(#pragma)
+# define DISABLE_WARNING(warning) PRAGMA(GCC diagnostic ignored #warning)
+#else
+# define DISABLE_WARNING(warning)
+#endif
+
+#ifdef DISABLE_SIGN_COMPARE_WARNINGS
+DISABLE_WARNING(-Wsign-compare)
+#endif
#ifndef FLEX_ARRAY
/*