From ac408c2ee991041a877723d587f5b556d31353e7 Mon Sep 17 00:00:00 2001 From: David Malcolm Date: Tue, 27 Jun 2023 17:21:42 -0400 Subject: [PATCH 91/98] FIXME: add gcc/testsuite/c-c++-common/analyzer/strspn-1.c --- .../c-c++-common/analyzer/strspn-1.c | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 gcc/testsuite/c-c++-common/analyzer/strspn-1.c diff --git a/gcc/testsuite/c-c++-common/analyzer/strspn-1.c b/gcc/testsuite/c-c++-common/analyzer/strspn-1.c new file mode 100644 index 000000000000..672e25fa3c17 --- /dev/null +++ b/gcc/testsuite/c-c++-common/analyzer/strspn-1.c @@ -0,0 +1,22 @@ +/* See e.g. https://en.cppreference.com/w/c/string/byte/strspn */ + +extern size_t strspn (const char *dest, const char *src); + +size_t +test_passthrough (const char *dest, const char *src) +{ + return strspn (dest, src); +} + +/* TODO: + "Returns the length of the maximum initial segment (span) of the null-terminated byte string pointed to by dest, that consists of only the characters found in the null-terminated byte string pointed to by src." + + "The behavior is undefined if either dest or src is not a pointer to a null-terminated byte string." + "Return value: The length of the maximum initial segment that contains only characters from the null-terminated byte string pointed to by src" + - complain on NULL dest + - complain on NULL src + - complain if dest if not nul-terminated + - complain if src if not nul-terminated + - simple examples + - what about taint? + */ -- 2.49.0