[dpdk-dev] [PATCH 3/3] librte_eal/common: Fix redeclaration of enumerator ‘REG_EAX’
Qiu, Michael
michael.qiu at intel.com
Thu Mar 5 14:54:09 CET 2015
On 3/5/2015 9:36 PM, David Marchand wrote:
> On Thu, Mar 5, 2015 at 2:23 PM, Bruce Richardson
> <bruce.richardson at intel.com <mailto:bruce.richardson at intel.com>> wrote:
>
> On Thu, Mar 05, 2015 at 09:15:39PM +0800, Michael Qiu wrote:
> > include/rte_cpuflags.h:154:2: error: redeclaration of enumerator
> ‘REG_EAX’
> > In file included from /usr/include/signal.h:358:0,
> > from /usr/include/sys/wait.h:30,
> > from /root/dpdk/app/test/test_mp_secondary.c:50:
> > /usr/include/sys/ucontext.h:180:3: note: previous definition of
> ‘REG_EAX’ was here
> >
> > In i686, from REG_EAX to REG_EDX are all defined in
> > /usr/include/sys/ucontext.h
>
>
> Well, this is the same for x86_64.
Yes, but for some reason, it was not include, see /usr/include/signal.h:358
# include <bits/sigstack.h>
# if defined __USE_XOPEN || defined __USE_XOPEN2K8
/* This will define `ucontext_t' and `mcontext_t'. */
# include <sys/ucontext.h>
# endif
So only if __USE_XOPEN or __USE_XOPEN2K8 been defined will include
<sys/ucontext.h>
Thanks,
Michael
>
> $ grep -rl '\<REG_EAX\>' /usr/include/
> /usr/include/x86_64-linux-gnu/sys/ucontext.h
>
> $ ls -l /usr/include/sys/ucontext.h
> lrwxrwxrwx 1 root root 34 Feb 22 12:45 /usr/include/sys/ucontext.h ->
> ../x86_64-linux-gnu/sys/ucontext.h
>
> So I am not sure I understand why we redefine stuff already available
> from the toolchain.
> Rather than prefixing, I think we should get rid of this and include
> the right header.
>
>
> --
> David Marchand
More information about the dev
mailing list