From: Junio C Hamano Date: Sat, 25 Sep 2010 05:51:26 GMT Subject: Re: [RFC/PATCH] Add --exclude-dir option to git grep Message-ID: <7vsk0ynzfl.fsf@alter.siamese.dyndns.org> In-Reply-To: <4C9D596C.4060906@ripton.net> David Ripton writes: >>> +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...?