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 <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Patrick Steinhardt 2024-06-07 08:38:54 +02:00 committed by Junio C Hamano
parent 8d3a7ce441
commit e463c5e8a0

View file

@ -355,7 +355,7 @@ struct option {
.type = OPTION_ALIAS, \
.short_name = (s), \
.long_name = (l), \
.value = (source_long_name), \
.value = (char *)(source_long_name), \
}
#define OPT_SUBCOMMAND_F(l, v, fn, f) { \