fix clang -Wunused-value warnings for error functions
[gitweb.git] / git-compat-util.h
index 9002bca28e1a91d88a95b66e0a9a924880bb62a0..77fd848511675c2330214c9f72c3c8b3b7238da6 100644 (file)
@@ -295,7 +295,7 @@ extern void warning(const char *err, ...) __attribute__((format (printf, 1, 2)))
  * behavior. But since we're only trying to help gcc, anyway, it's OK; other
  * compilers will fall back to using the function as usual.
  */
-#ifdef __GNUC__
+#if defined(__GNUC__) && ! defined(__clang__)
 #define error(fmt, ...) (error((fmt), ##__VA_ARGS__), -1)
 #endif