Skip to content

Commit e463c5e

Browse files
pks-tgitster
authored andcommitted
parse-options: cast long name for OPTION_ALIAS
We assign the long name for OPTION_ALIAS options to a non-constant value field. We know that the variable will never be written to, but this will cause warnings once we enable `-Wwrite-strings`. Cast away the constness to be prepared for this change. Signed-off-by: Patrick Steinhardt <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 8d3a7ce commit e463c5e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

parse-options.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,7 @@ struct option {
355355
.type = OPTION_ALIAS, \
356356
.short_name = (s), \
357357
.long_name = (l), \
358-
.value = (source_long_name), \
358+
.value = (char *)(source_long_name), \
359359
}
360360

361361
#define OPT_SUBCOMMAND_F(l, v, fn, f) { \

0 commit comments

Comments
 (0)