Skip to content

Commit fa2f83c

Browse files
committed
Merge branch 'jk/suppress-clang-warning'
* jk/suppress-clang-warning: fix clang -Wunused-value warnings for error functions
2 parents d82dd26 + 5ded807 commit fa2f83c

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

cache.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1147,7 +1147,7 @@ extern int check_repository_format_version(const char *var, const char *value, v
11471147
extern int git_env_bool(const char *, int);
11481148
extern int git_config_system(void);
11491149
extern int config_error_nonbool(const char *);
1150-
#ifdef __GNUC__
1150+
#if defined(__GNUC__) && ! defined(__clang__)
11511151
#define config_error_nonbool(s) (config_error_nonbool(s), -1)
11521152
#endif
11531153
extern const char *get_log_output_encoding(void);

git-compat-util.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ extern void warning(const char *err, ...) __attribute__((format (printf, 1, 2)))
297297
* behavior. But since we're only trying to help gcc, anyway, it's OK; other
298298
* compilers will fall back to using the function as usual.
299299
*/
300-
#ifdef __GNUC__
300+
#if defined(__GNUC__) && ! defined(__clang__)
301301
#define error(fmt, ...) (error((fmt), ##__VA_ARGS__), -1)
302302
#endif
303303

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-
#ifdef __GNUC__
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)