Re: [RFC/PATCH] Add --exclude-dir option to git grep
David Ripton <dripton@ripton.net> writes:
Show 12 quoted lines
>>> +static int exclude_dir_callback(const struct option *opt, const char *arg,
>>> + int unset)
>>> +{
>>> + struct string_list *exclude_dir_list = opt->value;
>>> + char *s1 = (char *)arg;
>>
>> What is this cast for?
>
> It avoids:
>
> "builtin/grep.c:893: warning: initialization discards qualifiers from
> pointer target type"And the reason why s1 cannot be of type "const char *" is...?