Skip to content

Commit

Permalink
config.c: mark die_bad_number as NORETURN
Browse files Browse the repository at this point in the history
This can help avoid -Wuninitialized false positives in
git_config_int and git_config_ulong, as the compiler now
knows that we do not return "ret" if we hit the error
codepath.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Jeff King authored and Junio C Hamano committed Apr 16, 2014
1 parent 7bbc4e8 commit 06bdc23
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions config.c
Original file line number Diff line number Diff line change
Expand Up @@ -552,6 +552,7 @@ int git_parse_ulong(const char *value, unsigned long *ret)
return 1;
}

NORETURN
static void die_bad_number(const char *name, const char *value)
{
const char *reason = errno == ERANGE ?
Expand Down

0 comments on commit 06bdc23

Please sign in to comment.