Skip to content

Commit 567fce1

Browse files
dschogitster
authored andcommitted
parse-options: adjust parse_opt_unknown_cb()s declared return type
In f41179f (parse-options: avoid magic return codes, 2019-01-27), the signature of the low-level parse-opt callback function was changed to return an `enum`. And while the implementations were changed, one declaration was left unchanged, still claiming to return `int`. This can potentially lead to problems, as compilers are free to choose any integral type for an `enum` as long as it can represent all declared values. Signed-off-by: Johannes Schindelin <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent ab15ad1 commit 567fce1

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

parse-options.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,9 @@ int parse_opt_commit(const struct option *, const char *, int);
286286
int parse_opt_tertiary(const struct option *, const char *, int);
287287
int parse_opt_string_list(const struct option *, const char *, int);
288288
int parse_opt_noop_cb(const struct option *, const char *, int);
289-
int parse_opt_unknown_cb(struct parse_opt_ctx_t *ctx, const struct option *, const char *, int);
289+
enum parse_opt_result parse_opt_unknown_cb(struct parse_opt_ctx_t *ctx,
290+
const struct option *,
291+
const char *, int);
290292
int parse_opt_passthru(const struct option *, const char *, int);
291293
int parse_opt_passthru_argv(const struct option *, const char *, int);
292294

0 commit comments

Comments
 (0)