On Mon, Aug 28, 2023 at 12:40 PM Bruce Richardson
<bruce.richard...@intel.com> wrote:
>
> When doing a build for a system with WAITPKG support and a modern
> compiler, we get build errors for the "_umonitor" intrinsic, due to the
> casting away of the "volatile" on the parameter.
>
> ../lib/eal/x86/rte_power_intrinsics.c: In function 'rte_power_monitor':
> ../lib/eal/x86/rte_power_intrinsics.c:113:22: error: passing argument 1
> of '_umonitor' discards 'volatile' qualifier from pointer target type
> [-Werror=discarded-qualifiers]
>   113 |         _umonitor(pmc->addr);
>         |                   ~~~^~~~~~
>
> We can avoid this issue by casting through "uintptr_t" and thereby
> remove the volatile without warning.  We also ensure comments are
> correct for each leg of the ifdef..else..endif block.
>
> Fixes: 60943c04f3bc ("eal/x86: use intrinsics for power management")
> Cc: roret...@linux.microsoft.com
>
> Signed-off-by: Bruce Richardson <bruce.richard...@intel.com>
> Acked-by: Morten Brørup <m...@smartsharesystems.com>
> Tested-by: David Marchand <david.march...@redhat.com>

Applied to fix build on the main branch, thanks.

We can look at the casting helper as a followup.


-- 
David Marchand

Reply via email to