[dpdk-dev] [PATCH v6 5/8] virtio: virtio vec rx

Thomas Monjalon thomas.monjalon at 6wind.com
Mon Nov 2 10:03:07 CET 2015


2015-11-02 08:49, Xie, Huawei:
> On 11/2/2015 3:31 PM, Thomas Monjalon wrote:
> > 2015-11-02 02:18, Xie, Huawei:
> >> On 10/31/2015 2:21 AM, Thomas Monjalon wrote:
> >>> Sorry, there is a clang error.
> >>>
> >>> 2015-10-29 22:53, Huawei Xie:
> >>>> +	_mm_prefetch((const void *)rused, _MM_HINT_T0);
> >>> virtio_rxtx_simple.c:197:2: error: cast from 'const void *' to
> >>>       'void *' drops const qualifier
> >> This is weird. This conversion is actually from 'void *' to 'const void
> >> *', not the opposite, so there should be no error.
> >> I checked clang build, it doesn't report error.
> >>     clang version 3.3 (tags/RELEASE_33/rc2)
> > I'm using clang 3.6.2.
> > Anybody else to check please?
> Thomas:
> 
> I checked clang-3.5 on Fedora 22 and clang-3.6 on Ubuntu 15.04.
> Clang-3.6 reports warnings, but the definition of this macro doesn't change.
> 
> Why (const void*) conversion is used in the code is because when
> __OPTIMIZE__ is defined, GCC defines first parameter to be "const void *".
> 
> Could you add the following macro(used in other vec pmds as well) before
> virtqueue_enqueue_recv_refill_simple or do i need to submit a new patchset?
> 
> +#ifndef __INTEL_COMPILER
> +#pragma GCC diagnostic ignored "-Wcast-qual"
> +#endif

OK I'll try it.


More information about the dev mailing list