Skip to content

Commit 368332c

Browse files
committed
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()
2 parents 8f6fd08 + 3e1952e commit 368332c

File tree

3 files changed

+3
-1
lines changed

3 files changed

+3
-1
lines changed

color.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ int color_parse_mem(const char *value, int value_len, char *dst)
215215
/* [fg [bg]] [attr]... */
216216
while (len > 0) {
217217
const char *word = ptr;
218-
struct color c;
218+
struct color c = { COLOR_UNSPECIFIED };
219219
int val, wordlen = 0;
220220

221221
while (len > 0 && !isspace(word[wordlen])) {

git-compat-util.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -436,6 +436,7 @@ static inline int const_error(void)
436436
return -1;
437437
}
438438
#define error(...) (error(__VA_ARGS__), const_error())
439+
#define error_errno(...) (error_errno(__VA_ARGS__), const_error())
439440
#endif
440441

441442
extern void set_die_routine(NORETURN_PTR void (*routine)(const char *err, va_list params));

usage.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,7 @@ void NORETURN die_errno(const char *fmt, ...)
148148
va_end(params);
149149
}
150150

151+
#undef error_errno
151152
int error_errno(const char *fmt, ...)
152153
{
153154
char buf[1024];

0 commit comments

Comments
 (0)