[dpdk-dev] [PATCH v2] net/virtio: fix build error with clang

Yuanhan Liu yuanhan.liu at linux.intel.com
Fri Sep 23 08:43:05 CEST 2016


On Fri, Sep 23, 2016 at 12:05:14PM +0530, Jerin Jacob wrote:
> On Fri, Sep 23, 2016 at 02:15:09PM +0800, Yuanhan Liu wrote:
> 
> Hi Yuanhan,
> 
> Thanks for this patch.
> 
> > Interestingly, clang and gcc has different prototype for _mm_prefetch().
> > For gcc, we have
> > 
> >    _mm_prefetch (const void *__P, enum _mm_hint __I)
> > 
> > While for clang, it's
> > 
> >    #define _mm_prefetch(a, sel) (__builtin_prefetch((void *)(a), 0, (sel)))
> > 
> > That how the following error comes with clang:
> > 
> >    error: cast from 'const void *' to 'void *' drops const qualifier
> >    [-Werror,-Wcast-qual]
> >            _mm_prefetch((const void *)rused, _MM_HINT_T0);
> >    /usr/lib/llvm-3.8/bin/../lib/clang/3.8.0/include/xmmintrin.h:684:58:
> >    note: expanded from macro '_mm_prefetch'
> >             #define _mm_prefetch(a, sel) (__builtin_prefetch((void *)(a),
> >                                           0, (sel)))
> > 
> > What's weird is that the build was actaully Okay before. I met it while
> > apply Jerin's vector support for ARM patch set: he just move this peiece
> > of code to another file, nothing else changed.
> > 
> > This patch fix the issue when Jerin's patchset is applied. Thus, I think
> > it's still needed.
> 
> The info notes can be moved under the "---" marker line to make git log
> clean.

Yes, kind of. The reason I want to put it here is to stree "how weird
this issue it is" :)

Without this piece, people may be confused why this patch is necessary,
because they may simply can't reproduce this issue.

> This patch review is holding the virtio arm NEON support. Appreciate any help
> in reviewing this patch.
> 
> http://dpdk.org/dev/patchwork/patch/14567/

I meant to apply this series long time ago, until I found a build issue.
I tried to fix it once, as you saw. But it somehow broke the icc.

And here is my 2nd try (sorry for being a bit late though).

	--yliu


More information about the dev mailing list