On Wed, Dec 20, 2023 at 4:39 PM David Marchand <[email protected]> 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 <[email protected]> > Acked-by: Stephen Hemminger <[email protected]> > Acked-by: Chengwen Feng <[email protected]> > --- > 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

