From 0db793fc510e3ec49b3631d3992f5ee0230ff0ac Mon Sep 17 00:00:00 2001 From: orbitcowboy Date: Sun, 8 May 2022 18:06:30 +0200 Subject: [PATCH] std.cfg: Improved configuration of vfprintf() --- cfg/std.cfg | 1 + test/cfg/std.c | 7 +++++++ test/cfg/std.cpp | 7 +++++++ 3 files changed, 15 insertions(+) diff --git a/cfg/std.cfg b/cfg/std.cfg index 7bd1b2a07..4f88ee728 100644 --- a/cfg/std.cfg +++ b/cfg/std.cfg @@ -1917,6 +1917,7 @@ + diff --git a/test/cfg/std.c b/test/cfg/std.c index 337d0efc3..16c7a45d1 100644 --- a/test/cfg/std.c +++ b/test/cfg/std.c @@ -1613,6 +1613,13 @@ void uninitvar_fprintf(FILE *Stream, char *Format, int Argument) (void)fprintf(Stream, Format, Argument); } +void nullPointer_vfprintf(FILE *Stream, const char *Format, va_list Arg) +{ + // cppcheck-suppress nullPointer + (void)vfprintf(Stream, NULL, Arg); + (void)vfprintf(Stream, Format, Arg); +} + void uninitvar_vfprintf(FILE *Stream, const char *Format, va_list Arg) { FILE *stream1, *stream2; diff --git a/test/cfg/std.cpp b/test/cfg/std.cpp index 890a1737a..327d9a58b 100644 --- a/test/cfg/std.cpp +++ b/test/cfg/std.cpp @@ -92,6 +92,13 @@ void nullPointer_qsort(void *base, std::size_t n, std::size_t size, int (*cmp)(c std::qsort(base, n, size, qsort_cmpfunc); } +void nullPointer_vfprintf(FILE *Stream, const char *Format, va_list Arg) +{ + // cppcheck-suppress nullPointer + (void)std::vfprintf(Stream, NULL, Arg); + (void)std::vfprintf(Stream, Format, Arg); +} + void *bufferAccessOutOfBounds_memchr(void *s, int c, size_t n) { char buf[42]={0};