summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2016-09-12 15:34:33 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2016-09-12 15:34:33 -0700
commit368332c471d28f8e301c61e47bbcb81f5ebbd8fd (patch)
treed6f921fa50eab8997f7f1854a8ec0cf45dacd60e
parentMerge branch 'jk/test-lib-drop-pid-from-results' (diff)
parentcolor_parse_mem: initialize "struct color" temporary (diff)
downloadtgif-368332c471d28f8e301c61e47bbcb81f5ebbd8fd.tar.xz
Merge branch 'jk/squelch-false-warning-from-gcc-o3'
* jk/squelch-false-warning-from-gcc-o3: color_parse_mem: initialize "struct color" temporary error_errno: use constant return similar to error()
-rw-r--r--color.c2
-rw-r--r--git-compat-util.h1
-rw-r--r--usage.c1
3 files changed, 3 insertions, 1 deletions
diff --git a/color.c b/color.c
index 81c2676723..1b95e6b2a7 100644
--- a/color.c
+++ b/color.c
@@ -215,7 +215,7 @@ int color_parse_mem(const char *value, int value_len, char *dst)
/* [fg [bg]] [attr]... */
while (len > 0) {
const char *word = ptr;
- struct color c;
+ struct color c = { COLOR_UNSPECIFIED };
int val, wordlen = 0;
while (len > 0 && !isspace(word[wordlen])) {
diff --git a/git-compat-util.h b/git-compat-util.h
index db89ba7748..2ad45b3f75 100644
--- a/git-compat-util.h
+++ b/git-compat-util.h
@@ -436,6 +436,7 @@ static inline int const_error(void)
return -1;
}
#define error(...) (error(__VA_ARGS__), const_error())
+#define error_errno(...) (error_errno(__VA_ARGS__), const_error())
#endif
extern void set_die_routine(NORETURN_PTR void (*routine)(const char *err, va_list params));
diff --git a/usage.c b/usage.c
index 1dad03fb5c..0efa3faf60 100644
--- a/usage.c
+++ b/usage.c
@@ -148,6 +148,7 @@ void NORETURN die_errno(const char *fmt, ...)
va_end(params);
}
+#undef error_errno
int error_errno(const char *fmt, ...)
{
char buf[1024];