[PATCH v2] eal: add nonnull and access function attributes
Ruifeng Wang
Ruifeng.Wang at arm.com
Mon Dec 5 11:17:15 CET 2022
> -----Original Message-----
> From: Morten Brørup <mb at smartsharesystems.com>
> Sent: Saturday, December 3, 2022 10:23 PM
> To: dev at dpdk.org; roretzla at linux.microsoft.com
> Cc: Ruifeng Wang <Ruifeng.Wang at arm.com>; zhoumin at loongson.cn; drc at linux.vnet.ibm.com;
> kda at semihalf.com; bruce.richardson at intel.com; konstantin.v.ananyev at yandex.ru; Morten
> Brørup <mb at smartsharesystems.com>
> Subject: [PATCH v2] eal: add nonnull and access function attributes
>
> Add "nonnull" function attribute to help the compiler detect a NULL pointer being passed
> to a function not accepting NULL pointers as an argument at build time.
>
> Add "access" function attribute to tell the compiler how a function accesses its pointer
> arguments.
>
> Add these attributes to the rte_memcpy() function, as the first in hopefully many to come.
>
> v2:
> * Only define "nonnull" for GCC and CLANG.
> * Append _param/_params to prepare for possible future attributes
> attached directly to the individual parameters, like __rte_unused.
> * Use RTE_TOOLCHAIN_GCC instead of RTE_CC_GCC, to fix complaints about
> GCC_VERSION being undefined.
> * Try to fix Doxygen compliants.
>
> Signed-off-by: Morten Brørup <mb at smartsharesystems.com>
> Acked-by: Tyler Retzlaff <roretzla at linux.microsoft.com>
> ---
> lib/eal/arm/include/rte_memcpy_32.h | 8 ++++++++ lib/eal/arm/include/rte_memcpy_64.h |
> 6 ++++++
> lib/eal/include/rte_common.h | 29 +++++++++++++++++++++++++++++
> lib/eal/ppc/include/rte_memcpy.h | 3 +++
> lib/eal/x86/include/rte_memcpy.h | 6 ++++++
> 5 files changed, 52 insertions(+)
>
Reviewed-by: Ruifeng Wang <ruifeng.wang at arm.com>
Thanks and regards.
More information about the dev
mailing list