From a98db2f436eade23a4626892b9c3dcd50f298472 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Sun, 9 Feb 2025 22:02:14 +0100 Subject: [PATCH] xstring-desc: Allow for better static analysis. * lib/xstring-desc.h (xsd_c): Declare a non-NULL return value. --- ChangeLog | 5 +++++ lib/xstring-desc.h | 5 +++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 0310e40fed..1ab751f289 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2025-02-09 Bruno Haible + + xstring-desc: Allow for better static analysis. + * lib/xstring-desc.h (xsd_c): Declare a non-NULL return value. + 2025-02-09 Bruno Haible mbsstr, mbscasestr, mbspcasecmp, unistr, unigbrk: Simplify. diff --git a/lib/xstring-desc.h b/lib/xstring-desc.h index 7957795d98..20b3e72a18 100644 --- a/lib/xstring-desc.h +++ b/lib/xstring-desc.h @@ -19,7 +19,8 @@ #ifndef _XSTRING_DESC_H #define _XSTRING_DESC_H 1 -/* This file uses _GL_INLINE_HEADER_BEGIN, _GL_INLINE. */ +/* This file uses _GL_INLINE_HEADER_BEGIN, _GL_INLINE, + _GL_ATTRIBUTE_DEALLOC_FREE, _GL_ATTRIBUTE_RETURNS_NONNULL. */ #if !_GL_CONFIG_H_INCLUDED #error "Please include config.h first." #endif @@ -95,7 +96,7 @@ xsd_copy (string_desc_t s) } GL_XSTRING_DESC_INLINE -_GL_ATTRIBUTE_DEALLOC_FREE +_GL_ATTRIBUTE_DEALLOC_FREE _GL_ATTRIBUTE_RETURNS_NONNULL char * xsd_c (string_desc_t s) { -- 2.39.5