qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] ui/gtk: fix NULL pointer dereference


From: Akihiko Odaki
Subject: Re: [PATCH] ui/gtk: fix NULL pointer dereference
Date: Mon, 8 Mar 2021 23:17:45 +0900

2021年3月8日(月) 23:03 Christian Schoenebeck <qemu_oss@crudebyte.com>:
>
> BTW, there is __nonnull supported by clang, e.g.:
>
> static void foo(void *__nonnull p) {
>         ...
> }
>
> Maybe as an optionally defined macro (if supported by compiler) this could be
> a useful tool for such intended nonnull designs, as it immediately emits
> compiler errors.
>
> Best regards,
> Christian Schoenebeck
>
>

GCC has nonnull attribute and clang accepts it too. However, it
specifies argument indices, which is harder to understand and to
maintain.
__attribute__((nonnull(2)))
void f(void *k, void *l);

Regards,
Akihiko Odaki



reply via email to

[Prev in Thread] Current Thread [Next in Thread]