[libvirt PATCH v2] Fix some wrong usage of ATTRIBUTE_NONNULL

Michal Privoznik mprivozn at redhat.com
Tue Jun 9 09:50:26 UTC 2020


On 6/6/20 12:52 PM, Bihong Yu wrote:
> There are some wrong usage of ATTRIBUTE_NONNULL, which may cause the compilation fail. The
> ATTRIBUTE_NONNULL is the define of __attribute__((__nonnull__(m))), which declares that the
> input pointer parameter of funciton should not be NULL. If we declare some input pointer
> parameter of the function is ATTRIBUTE_NONNULL, the function should not redundancy check of
> the pointer parameter. And the ATTRIBUTE_NONNULL can only be using to pointer.
> 
>>From 01a7301d50d6c1388df80dfa9af9da2582deec82 Mon Sep 17 00:00:00 2001
> From: Bihong Yu <yubihong at huawei.com>
> Date: Sat, 6 Jun 2020 18:20:16 +0800
> Subject: [PATCH] bugifx: fix some wrong usage of ATTRIBUTE_NONNULL
> 
> The ATTRIBUTE_NONNULL is the define of __attribute__((__nonnull__(m))), which
> declares that the input pointer parameter of funciton should not be NULL. If we
> declare some input pointer parameter of the function is ATTRIBUTE_NONNULL, the
> function should not redundancy check of the pointer parameter. And the
> ATTRIBUTE_NONNULL can only be using to pointer.
> 
> Signed-off-by:Bihong Yu <yubihong at huawei.com>
> Reviewed-by:Chuan Zheng <zhengchuan at huawei.com>
> ---
>   src/libvirt_internal.h | 3 +--
>   src/util/vircommand.h  | 3 +--
>   2 files changed, 2 insertions(+), 4 deletions(-)
> 

Tweaked the commit message a bit and pushed.

Congratulations on your first libvirt contribution!

Michal




More information about the libvir-list mailing list