On Wed, Dec 20, 2023 at 4:39 PM David Marchand
<david.march...@redhat.com> wrote:
>
> gcc builtin __builtin_strchr can be used as a static assertion to check
> whether passed format strings contain a \n.
> This can be useful to detect double \n in log messages.
>
> Signed-off-by: David Marchand <david.march...@redhat.com>
> Acked-by: Stephen Hemminger <step...@networkplumber.org>
> Acked-by: Chengwen Feng <fengcheng...@huawei.com>
> ---
> Changes since v4:
> - fixed build with -pedantic,

Unfortunately, upon testing, clang does not support constant
expression folding in (Ubuntu 20.04 and Fedora 37 at least) older
versions.
So we may manage to make this check work with clang, but that's for the future.


-- 
David Marchand

Reply via email to