From: Patrick Steinhardt Date: Fri, 7 Jun 2024 06:38:54 +0000 (+0200) Subject: parse-options: cast long name for OPTION_ALIAS X-Git-Tag: v2.46.0-rc0~52^2~10 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e463c5e8a0c306b62c25ff5856087ab32403158a;p=thirdparty%2Fgit.git 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 Signed-off-by: Junio C Hamano --- diff --git a/parse-options.h b/parse-options.h index bd62e20268..ae15342390 100644 --- a/parse-options.h +++ b/parse-options.h @@ -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) { \