> From: Thomas Monjalon <tho...@monjalon.net> > Sent: Tuesday, June 16, 2020 12:17 PM > To: dmitry.kozl...@gmail.com; Tasnim Bashar <tbas...@mellanox.com> > Cc: dev@dpdk.org; harini.ramakrish...@microsoft.com; > pallavi.ka...@intel.com; ranjit.me...@intel.com; ocard...@microsoft.com; > navas...@linux.microsoft.com; Tal Shnaiderman <tal...@mellanox.com>; Fady > Bader <f...@mellanox.com>; Ophir Munk <ophi...@mellanox.com> > Subject: Re: [dpdk-dev] [PATCH v3] eal/windows: fix invalid thread handle > > 16/06/2020 20:53, Tasnim Bashar: > > > From: Thomas Monjalon <tho...@monjalon.net> > > > 02/06/2020 04:00, Tasnim Bashar: > > > > Casting thread ID to handle is not accurate way to get thread handle. > > > > Need to use OpenThread function to get thread handle from thread ID. > > > > > > > > pthread_setaffinity_np and pthread_getaffinity_np functions for > > > > Windows are affected because of it. > > > > > > > > Signed-off-by: Tasnim Bashar <tbas...@mellanox.com> > > > > --- > > > > v3: WA to remove warning(-Wmaybe-uninitialized) > > > > > > The -Wmaybe-uninitialized warning was there before this patch. > > > Shouldn't it be a separate patch before this one? > > > > The warning appeared only on this patch, so we don't need to separate > > it > > I can see the warning on the main repo when cross-compiling with MinGW on > Linux.
I didn't test with cross compilation. In that case we can separate the warning fix from this patch. > > [...] > > > > + memset(cpuset, 0, sizeof(rte_cpuset_t)); > > > > > > Shouldn't we use RTE_CPU_ZERO instead of memset? > > > > If we use CPU_ZERO or CPU_SET, we still get the same warning! > > That's strange. Does it mean CPU_ZERO is broken in > lib/librte_eal/windows/include/sched.h ? > I don't see any issues in CPU_ZERO. I thinks the issue with compiler interpretation. I also notice if we check the cpuset is null or not, also removes the warning. But the strange thing is, it removes the warning only if we check like this -> if(!cpuset) If we check like this -> if(cpuset != NULL), we still get the warning