[PATCH v5 11/13] log: add a per line log helper
David Marchand
david.marchand at redhat.com
Wed Dec 20 16:42:02 CET 2023
On Wed, Dec 20, 2023 at 4:39 PM David Marchand
<david.marchand at 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.marchand at redhat.com>
> Acked-by: Stephen Hemminger <stephen at networkplumber.org>
> Acked-by: Chengwen Feng <fengchengwen at 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
More information about the dev
mailing list