Skip to content

Commit a3bc3d0

Browse files
sunshinecogitster
authored andcommitted
parse-options: fix clang opterror() -Wunused-value warning
a469a10 (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. 5ded807 (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. 1158826 (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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 0bf5ce4 commit a3bc3d0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

parse-options.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ extern NORETURN void usage_msg_opt(const char *msg,
177177

178178
extern int optbug(const struct option *opt, const char *reason);
179179
extern int opterror(const struct option *opt, const char *reason, int flags);
180-
#if defined(__GNUC__) && ! defined(clang)
180+
#if defined(__GNUC__) && ! defined(__clang__)
181181
#define opterror(o,r,f) (opterror((o),(r),(f)), -1)
182182
#endif
183183

0 commit comments

Comments
 (0)