Message ID | 20160117175345.GP3017@tucnak.redhat.com |
---|---|
State | New |
Headers | show |
2016-01-17 20:53 GMT+03:00 Jakub Jelinek <jakub@redhat.com>: > Hi! > > The following patch fixes a warning in libmpx: > ../../../../libmpx/mpxwrap/mpx_wrappers.c:492:8: warning: assignment discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers] > *d = *s; > ^ > > Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk? OK. Thanks for the fix! Ilya > > 2016-01-17 Jakub Jelinek <jakub@redhat.com> > > * mpxwrap/mpx_wrappers.c (__mpx_wrapper_memmove): Avoid > -Wdiscarded-qualifiers warning. Fix up formatting. > > --- libmpx/mpxwrap/mpx_wrappers.c.jj 2015-12-31 01:11:17.000000000 +0100 > +++ libmpx/mpxwrap/mpx_wrappers.c 2016-01-16 10:37:54.488048781 +0100 > @@ -486,12 +486,12 @@ __mpx_wrapper_memmove (void *dst, const > /* When we copy exactly one pointer it is faster to > just use bndldx + bndstx. */ > if (n == sizeof (void *)) > - { > - const void **s = (const void**)src; > - void **d = (void**)dst; > - *d = *s; > - return dst; > - } > + { > + void *const *s = (void *const *) src; > + void **d = (void **) dst; > + *d = *s; > + return dst; > + } > > memmove (dst, src, n); > > > > Jakub
--- libmpx/mpxwrap/mpx_wrappers.c.jj 2015-12-31 01:11:17.000000000 +0100 +++ libmpx/mpxwrap/mpx_wrappers.c 2016-01-16 10:37:54.488048781 +0100 @@ -486,12 +486,12 @@ __mpx_wrapper_memmove (void *dst, const /* When we copy exactly one pointer it is faster to just use bndldx + bndstx. */ if (n == sizeof (void *)) - { - const void **s = (const void**)src; - void **d = (void**)dst; - *d = *s; - return dst; - } + { + void *const *s = (void *const *) src; + void **d = (void **) dst; + *d = *s; + return dst; + } memmove (dst, src, n);