Paolo Bonzini wrote: > From: Aharon Robbins <[email protected]> > > * src/dfa.c (dfaexec): Cast p when passing it to prepare_wc_buf. > --- > src/dfa.c | 4 ++-- > 1 files changed, 2 insertions(+), 2 deletions(-) > > I got this patch from Arnold Robbins in private mail. > Ok to apply?
I tend to avoid accommodating those compiler warnings, precisely because doing so results in adding casts (and hence an intrinsic maintainability penalty), but won't object if you add a space after each ")", per GNU indent. Not that the rest of grep's code is a model of uniform/compliant formatting style, but still... > diff --git a/src/dfa.c b/src/dfa.c > index 5984a20..14c7087 100644 > --- a/src/dfa.c > +++ b/src/dfa.c > @@ -3199,7 +3199,7 @@ dfaexec (struct dfa *d, char const *begin, char *end, > MALLOC(mblen_buf, unsigned char, end - begin + 2); > MALLOC(inputwcs, wchar_t, end - begin + 2); > memset(&mbs, 0, sizeof(mbstate_t)); > - prepare_wc_buf (p, end); > + prepare_wc_buf ((const char *)p, end); > } > #endif /* MBS_SUPPORT */ > > @@ -3276,7 +3276,7 @@ dfaexec (struct dfa *d, char const *begin, char *end, > > #if MBS_SUPPORT > if (d->mb_cur_max > 1) > - prepare_wc_buf (p, end); > + prepare_wc_buf ((const char *)p, end); > #endif > }
