parse-options: fix clang opterror() -Wunused-value warning
authorEric Sunshine <sunshine@sunshineco.com>
Fri, 9 Aug 2013 09:06:17 +0000 (05:06 -0400)
committerJunio C Hamano <gitster@pobox.com>
Fri, 9 Aug 2013 16:27:44 +0000 (09:27 -0700)
a469a1019352b8ef (silence some -Wuninitialized false positives;
2012-12-15) triggered "unused value" warnings when the return value of
opterror() and several other error-related functions was not used.
5ded807f7c0be10e (fix clang -Wunused-value warnings for error functions;
2013-01-16) applied a fix by adding #if !defined(__clang__) in cache.h
and git-compat-util.h, but misspelled it as #if !defined(clang) in
parse-options.h. Fix this.

This mistake went unnoticed because existing callers of opterror()
utilize its return value. 1158826394e162c5 (parse-options: add
OPT_CMDMODE(); 2013-07-30), however, adds a new invocation of opterror()
which ignores the return value, thus triggering the "unused value"
warning.

Signed-off-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
parse-options.h
index 1c8bd8d5a0894d9deda1e849165ff38e8d594a4d..cb226f77d426b08ad85d0c12cc77998dc74f2cfb 100644 (file)
@@ -177,7 +177,7 @@ extern NORETURN void usage_msg_opt(const char *msg,
 
 extern int optbug(const struct option *opt, const char *reason);
 extern int opterror(const struct option *opt, const char *reason, int flags);
-#if defined(__GNUC__) && ! defined(clang)
+#if defined(__GNUC__) && ! defined(__clang__)
 #define opterror(o,r,f) (opterror((o),(r),(f)), -1)
 #endif